Skip to content

Commit

Permalink
Add podman in the maven image
Browse files Browse the repository at this point in the history
Signed-off-by: rick <1450685+LinuxSuRen@users.noreply.github.com>
  • Loading branch information
LinuxSuRen committed Aug 11, 2021
1 parent e96b79e commit d14eb44
Show file tree
Hide file tree
Showing 12 changed files with 696 additions and 18 deletions.
292 changes: 292 additions & 0 deletions .github/workflows/build-podman.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,292 @@
name: Build Podman Images

on:
push:
branches:
- master
- test-* # make it be easier for contributors to test
tags:
- 'v*.*.*'
pull_request:
branches:
- 'master'

jobs:
BuildBase:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-base
ghcr.io/${{ github.repository_owner }}/builder-base
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}-podman
type=sha
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-base
tags: |
type=schedule
type=ref,event=branch,suffix=-podman
type=ref,event=pr,suffix=-podman
type=semver,pattern=v{{version}}-podman
type=sha,suffix=-podman
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v2.4.0
if: github.repository_owner == 'kubesphere'
with:
context: base
file: base/podman/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
- name: Build and push Docker images for Contributors
uses: docker/build-push-action@v2.4.0
if: github.repository_owner != 'kubesphere'
with:
context: base
file: base/podman/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64

BuildGo:
needs: BuildBase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-go
ghcr.io/${{ github.repository_owner }}/builder-go
tags: |
type=schedule
type=ref,event=branch,suffix=-podman
type=ref,event=pr,suffix=-podman
type=semver,pattern=v{{version}}-podman
type=sha,suffix=-podman
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-go
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern=v{{version}}-podman
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v2.4.0
if: github.repository_owner == 'kubesphere'
with:
context: go
file: go/podman/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
- name: Build and push Docker images for Contributors
uses: docker/build-push-action@v2.4.0
if: github.repository_owner != 'kubesphere'
with:
context: go
file: go/podman/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64

BuildMaven:
needs: BuildBase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-maven
ghcr.io/${{ github.repository_owner }}/builder-maven
tags: |
type=schedule
type=ref,event=branch,suffix=-podman
type=ref,event=pr,suffix=-podman
type=semver,pattern=v{{version}}-podman
type=sha,suffix=-podman
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-maven
tags: |
type=schedule
type=ref,event=branch,suffix=-podman
type=ref,event=pr,suffix=-podman
type=semver,pattern=v{{version}}-podman
type=sha,suffix=-podman
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v2.4.0
if: github.repository_owner == 'kubesphere'
with:
context: maven
file: maven/podman/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
- name: Build and push Docker images for Contributors
uses: docker/build-push-action@v2.4.0
if: github.repository_owner != 'kubesphere'
with:
context: maven
file: maven/podman/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64

BuildNodeJs:
needs: BuildBase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Docker meta for KubeSphere
id: meta
if: github.repository_owner == 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
kubespheredev/builder-nodejs
ghcr.io/${{ github.repository_owner }}/builder-nodejs
tags: |
type=schedule
type=ref,event=branch,suffix=-podman
type=ref,event=pr,suffix=-podman
type=semver,pattern=v{{version}}-podman
type=sha,suffix=-podman
- name: Docker meta for Contributors
id: metaContributors
if: github.repository_owner != 'kubesphere'
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository_owner }}/builder-nodejs
tags: |
type=schedule
type=ref,event=branch,suffix=-podman
type=ref,event=pr,suffix=-podman
type=semver,pattern=v{{version}}-podman
type=sha,suffix=-podman
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_SECRETS }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v2.4.0
if: github.repository_owner == 'kubesphere'
with:
context: nodejs
file: nodejs/podman/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64
- name: Build and push Docker images for Contributors
uses: docker/build-push-action@v2.4.0
if: github.repository_owner != 'kubesphere'
with:
context: nodejs
file: nodejs/podman/Dockerfile
tags: ${{ steps.metaContributors.outputs.tags }}
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.metaContributors.outputs.labels }}
platforms: linux/amd64
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
COMMIT := $(shell git rev-parse --short HEAD)
VERSION := dev-$(shell git describe --tags $(shell git rev-list --tags --max-count=1))

build-base-podman:
docker build base -f base/podman/Dockerfile -t kubespheredev/builder-base:$(VERSION)-podman
push-base-podman:
docker push kubespheredev/builder-base:$(VERSION)-podman

build-maven-podman:
docker build maven -f maven/podman/Dockerfile -t kubespheredev/builder-maven:$(VERSION)-podman
push-maven-podman:
docker push kubespheredev/builder-maven:$(VERSION)-podman

4 changes: 1 addition & 3 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN yum install -y epel-release && \
yum -y clean all --enablerepo='*'

RUN wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz && \
tar zxvf git-2.9.5.tar.gz && \
tar zxvf git-2.9.5.tar.gz --no-same-owner && \
cd git-2.9.5 && \
make configure && \
./configure prefix=/usr/local/git/ && \
Expand Down Expand Up @@ -57,5 +57,3 @@ COPY ./ ./
RUN ./hack/install_utils.sh && rm -rf ./*

CMD ["docker","version"]


14 changes: 14 additions & 0 deletions base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
There're two base images base on different container runtime here:

* Docker
* Podman

## Podman

In order to make it be easy to use. We provide some default conf files:

* [containers.conf](containers.conf)
* [registries.conf](registries.conf)
* Add `docker.io` into the default registries for keeping compatible
* [storage.conf](storage.conf)

3 changes: 3 additions & 0 deletions base/containers.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[engine]
cgroup_manager="cgroupfs"
events_logger="file"
31 changes: 16 additions & 15 deletions base/hack/install_utils.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
#!/usr/bin/env bash


ARCH=$(uname -m)

echo $ARCH

# Docker
DOCKER_VERSION=18.09.9
if [[ ${ARCH} == 'x86_64' ]]; then
curl -f https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz | tar xvz && \
mv docker/docker /usr/bin/ && \
rm -rf docker
elif [[ ${ARCH} == 'aarch64' ]]
then
curl -f https://download.docker.com/linux/static/stable/aarch64/docker-$DOCKER_VERSION.tgz | tar xvz && \
mv docker/docker /usr/bin/ && \
rm -rf docker
else
echo "do not support this arch"
exit 1
if [[ ${EXCLUDE_DOCKER} != '1' ]]; then
# Docker
DOCKER_VERSION=18.09.9
if [[ ${ARCH} == 'x86_64' ]]; then
curl -f https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz | tar xvz && \
mv docker/docker /usr/bin/ && \
rm -rf docker
elif [[ ${ARCH} == 'aarch64' ]]
then
curl -f https://download.docker.com/linux/static/stable/aarch64/docker-$DOCKER_VERSION.tgz | tar xvz && \
mv docker/docker /usr/bin/ && \
rm -rf docker
else
echo "do not support this arch"
exit 1
fi
fi

# Helm
Expand Down
Loading

0 comments on commit d14eb44

Please sign in to comment.