Initial commit

This commit is contained in:
Aleksandar Puharic 2022-01-14 21:54:59 +01:00
commit e286305362
Signed by: xZero707
GPG Key ID: 3CC53DCAA9C237BB
5 changed files with 117 additions and 0 deletions

35
.github/workflows/image.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Build docker s6-overlay rootfs image
on:
push:
branches: master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
- name: Cache Docker layers
uses: actions/cache@v2
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
config-inline: |
[worker.oci]
max-parallelism = 16
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build image
run: build/bin/build

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
# First stage - Download s6-overlay
ARG DOWNLOADER_ALPINE_VERSION=3.15
# First stage - Download s6-overlay and unpack it
FROM --platform=${TARGETPLATFORM} alpine:${DOWNLOADER_ALPINE_VERSION} AS downloader
ARG TARGETPLATFORM
# S6 Overlay
ARG S6_OVERLAY_VERSION="v2.2.0.3"
ARG S6_OVERLAY_RELEASE="https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${TARGETPLATFORM}.tar.gz"
RUN wget -O /tmp/s6overlay.tar.gz $(echo ${S6_OVERLAY_RELEASE} | sed 's/linux\///g' | sed 's/arm64/aarch64/g' | sed 's/arm\/v7/armhf/g') \
&& mkdir -p /s6-overlay \
&& tar xzf /tmp/s6overlay.tar.gz -C /s6-overlay
# Final stage
FROM scratch AS s6-rootfs
LABEL maintainer="Aleksandar Puharic <aleksandar@puharic.com>"
COPY --from=downloader ["/s6-overlay/", "/"]

1
README.md Normal file
View File

@ -0,0 +1 @@
### S6-overlay rootfs

3
build/bin/build Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
docker buildx bake --push --file build/docker-bake.hcl

55
build/docker-bake.hcl Normal file
View File

@ -0,0 +1,55 @@
group "default" {
targets = ["2.1.0.2", "2.2.0.0", "2.2.0.1", "2.2.0.2", "2.2.0.3"]
}
target "build-dockerfile" {
dockerfile = "Dockerfile"
}
target "build-platforms" {
platforms = ["linux/amd64", "linux/armhf", "linux/aarch64"]
}
target "build-common" {
pull = true
}
target "2.1.0.2" {
inherits = ["build-dockerfile", "build-platforms", "build-common"]
tags = ["docker.io/nlss/s6-rootfs:2.1.0.2", "docker.io/nlss/s6-rootfs:2.1"]
args = {
S6_OVERLAY_VERSION = "v2.1.0.2"
}
}
target "2.2.0.0" {
inherits = ["build-dockerfile", "build-platforms", "build-common"]
tags = ["docker.io/nlss/s6-rootfs:2.2.0.0"]
args = {
S6_OVERLAY_VERSION = "v2.2.0.0"
}
}
target "2.2.0.1" {
inherits = ["build-dockerfile", "build-platforms", "build-common"]
tags = ["docker.io/nlss/s6-rootfs:2.2.0.1"]
args = {
S6_OVERLAY_VERSION = "v2.2.0.1"
}
}
target "2.2.0.2" {
inherits = ["build-dockerfile", "build-platforms", "build-common"]
tags = ["docker.io/nlss/s6-rootfs:2.2.0.2"]
args = {
S6_OVERLAY_VERSION = "v2.2.0.2"
}
}
target "2.2.0.3" {
inherits = ["build-dockerfile", "build-platforms", "build-common"]
tags = ["docker.io/nlss/s6-rootfs:2.2.0.3", "docker.io/nlss/s6-rootfs:2.2", "docker.io/nlss/s6-rootfs:latest"]
args = {
S6_OVERLAY_VERSION = "v2.2.0.3"
}
}