1
0
mirror of https://github.com/phusion/baseimage-docker.git synced 2026-03-26 12:29:07 +00:00

Merge pull request #598 from phusion/focal-1.1.0

CI: Move to GitHub actions
This commit is contained in:
Travis Rowland
2021-09-02 16:12:56 -06:00
committed by GitHub
6 changed files with 78 additions and 78 deletions

View File

@@ -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

76
.github/workflows/main.yml vendored Normal file
View File

@@ -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 }}

View File

@@ -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

View File

@@ -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:

View File

@@ -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._

View File

@@ -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