diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a2ed39c..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,21 +0,0 @@ -version: 2 -jobs: - build: - machine: true - steps: - - checkout - #- run: - # name : Getting docker - # command: curl https://get.docker.com | sh - - run: - name: Enabling qemu - command: docker run --rm --privileged multiarch/qemu-user-static:register --reset - - run: - name: Building arm based image. - command: docker build -t arm-test . - - run: - name: Listing built images - command: docker images - # - run: - # name: Running arm based image. - # command: docker run --rm arm-test \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..86eb8ae --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,76 @@ +name: Release + +on: + workflow_dispatch: + push: + branches: + - focal-1.1.0 + - master + +jobs: + build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[ci-skip]')" + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prepare + id: prep + run: | + DOCKER_IMAGE=phusion/baseimage + GIT_BRANCH=${GITHUB_REF##*/} + # Set the platforms to build for here and thus reduce duplicating it. + PLATFORMS=amd64,arm,arm64 + TAGS="${DOCKER_IMAGE}:${GIT_BRANCH}, ghcr.io/${{ github.repository_owner }}/baseimage:${GIT_BRANCH}" + + # Set output parameters. + + if [ "${{github.event_name}}" == "pull_request" ]; then + echo ::set-output name=push::false + else + echo ::set-output name=push::true + echo ::set-output name=tags::${TAGS} + echo ::set-output name=branch::${GIT_BRANCH} + echo ::set-output name=docker_image::${DOCKER_IMAGE} + fi + echo ::set-output name=platforms::${PLATFORMS} + + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: ${{ steps.prep.outputs.platforms }} + + - name: Login to GHCR (Github Container Registry) + uses: docker/login-action@v1 + if: github.event_name != 'pull_request' + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + with: + install: true + version: latest + driver-opts: image=moby/buildkit:latest + + + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push + uses: docker/build-push-action@v2 + with: + builder: ${{ steps.buildx.outputs.name }} + context: image + platforms: ${{ steps.prep.outputs.platforms }} + push: ${{ steps.prep.outputs.push }} + tags: ${{ steps.prep.outputs.tags }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64c33bb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,53 +0,0 @@ -os: linux - -dist: focal - -language: c - -services: - - docker - -addons: - apt: - packages: - - docker-ce - - qemu-user-static - -env: - global: - # - VERSION=${TRAVIS_TAG} - - VERSION=${TRAVIS_BRANCH} - - DOCKER_CLI_EXPERIMENTAL=enabled - - QEMU_VERSION=v6.1.0-1 - - matrix: - # PLATFORM = Base image architecture to be used - # QEMU_ARCH = qemu binary to be downloaded from https://github.com/multiarch/qemu-user-static/releases - # TAG_ARCH = Tag to be applied to the image when upload to DockerHub -# - PLATFORM=amd64 QEMU_ARCH=i386 TAG_ARCH=386 - - PLATFORM=amd64 QEMU_ARCH=amd64 TAG_ARCH=amd64 - - PLATFORM=arm64 QEMU_ARCH=aarch64 TAG_ARCH=arm64 -# - PLATFORM=arm QEMU_ARCH=arm TAG_ARCH=arm -# - PLATFORM=ppc64le QEMU_ARCH=ppc64le TAG_ARCH=ppc64le -# - PLATFORM=s390x QEMU_ARCH=s390x TAG_ARCH=s390x - -before_script: - - echo '{"experimental":true}' | sudo tee /etc/docker/daemon.json - - sudo service docker restart - -script: - - make build test - - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then - docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}"; - make release; - fi - -jobs: - include: - - stage: deploy - env: - - ARCHS="amd64 arm64" - script: - - echo $NAME:$VERSION_TAG - - echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin - - make build_multiarch diff --git a/Makefile b/Makefile index 0a78cec..fe24996 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,6 @@ VERSION_ARG ?= $(VERSION) all: build build: - ./build.sh docker build --no-cache -t $(NAME):$(VERSION_ARG) $(BUILD_ARG) --build-arg QEMU_ARCH=$(QEMU_ARCH) --platform $(PLATFORM) --rm image build_multiarch: diff --git a/README.md b/README.md index 92055aa..2f4b64b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # A minimal Ubuntu base image modified for Docker-friendliness -[![](https://badge.imagelayers.io/phusion/baseimage:latest.svg)](https://imagelayers.io/?images=phusion/baseimage:latest 'Get your own badge on imagelayers.io') -[![Travis](https://img.shields.io/travis/phusion/baseimage-docker.svg)](https://travis-ci.org/phusion/baseimage-docker) +[![Release](https://github.com/phusion/baseimage-docker/actions/workflows/main.yml/badge.svg?branch=focal-1.1.0)](https://github.com/phusion/baseimage-docker/actions/workflows/main.yml) _Baseimage-docker only consumes 8.3 MB RAM and is much more powerful than Busybox or Alpine. See why below._ diff --git a/image/Dockerfile b/image/Dockerfile index 7e074d5..b800988 100644 --- a/image/Dockerfile +++ b/image/Dockerfile @@ -2,7 +2,7 @@ ARG BASE_IMAGE=ubuntu:20.04 FROM $BASE_IMAGE ARG QEMU_ARCH -ADD x86_64_qemu-${QEMU_ARCH}-static.tar.gz /usr/bin +#ADD x86_64_qemu-${QEMU_ARCH}-static.tar.gz /usr/bin COPY . /bd_build