ソースを参照

Bump Alpine version to 3.13

Mohammad Abdolirad 2 年 前
コミット
ceca17f6a7
3 ファイル変更137 行追加0 行削除
  1. 62 0
      .github/workflows/main.yml
  2. 37 0
      3.13/Dockerfile
  3. 38 0
      docker-bake.hcl

+ 62 - 0
.github/workflows/main.yml

@@ -0,0 +1,62 @@
+name: build
+
+on:
+  push:
+    branches:
+      - 'master'
+
+jobs:
+  docker:
+    runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        alpine: [ "3.13" ]
+        variant: [ "", "openrc" ]
+        latest: [ false ]
+        include:
+          - alpine: 3.16
+            variant: ""
+            latest: true
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v2
+
+      - name: Docker metadata
+        id: meta
+        uses: docker/metadata-action@v4
+        with:
+          images: |
+            dockage/alpine
+          tags: |
+            type=raw,value=${{ matrix.alpine }},enable=${{ matrix.variant == '' }}
+            type=raw,value=${{ matrix.alpine }}-${{ matrix.variant }},enable=${{ matrix.variant != '' }}
+            type=raw,value=latest,enable=${{ matrix.variant }}
+
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v2
+
+      - name: Login to DockerHub
+        if: ${{ github.event_name != 'pull_request' }}
+        uses: docker/login-action@v2
+        with:
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
+          password: ${{ secrets.DOCKERHUB_PASSWORD }}
+
+      - name: Build images
+        uses: docker/bake-action@v2
+        with:
+          push: ${{ is_default_branch }}
+          targets: ${{ matrix.variant }}
+          files: |
+            ${{ steps.meta.outputs.bake-file }}
+            ./docker-bake.hcl
+        env:
+          ALPINE_VERSION: ${{ matrix.alpine }}
+
+      - name: Docker Hub Description
+        uses: peter-evans/dockerhub-description@v3
+        if: ${{ github.event_name == 'push' && is_default_branch }}
+        with:
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
+          password: ${{ secrets.DOCKERHUB_PASSWORD }}
+          short-description: ${{ github.event.repository.description }}

+ 37 - 0
3.13/Dockerfile

@@ -0,0 +1,37 @@
+FROM alpine:3.13.10 AS base
+
+LABEL maintainer="The Dockage Authors"
+
+RUN echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \
+    && echo '@edgecommunity http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories \
+    && echo '@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories \
+    && apk add --no-cache su-exec ca-certificates
+
+FROM base AS openrc
+
+RUN apk add --no-cache openrc \
+    # Disable getty's
+    && sed -i 's/^\(tty\d\:\:\)/#\1/g' /etc/inittab \
+    && sed -i \
+        # Change subsystem type to "docker"
+        -e 's/#rc_sys=".*"/rc_sys="docker"/g' \
+        # Allow all variables through
+        -e 's/#rc_env_allow=".*"/rc_env_allow="\*"/g' \
+        # Start crashed services
+        -e 's/#rc_crashed_stop=.*/rc_crashed_stop=NO/g' \
+        -e 's/#rc_crashed_start=.*/rc_crashed_start=YES/g' \
+        # Define extra dependencies for services
+        -e 's/#rc_provide=".*"/rc_provide="loopback net"/g' \
+        /etc/rc.conf \
+    # Remove unnecessary services
+    && rm -f /etc/init.d/hwdrivers \
+            /etc/init.d/hwclock \
+            /etc/init.d/hwdrivers \
+            /etc/init.d/modules \
+            /etc/init.d/modules-load \
+            /etc/init.d/modloop \
+    # Can't do cgroups
+    && sed -i 's/\tcgroup_add_service/\t#cgroup_add_service/g' /lib/rc/sh/openrc-run.sh \
+    && sed -i 's/VSERVER/DOCKER/Ig' /lib/rc/sh/init.sh
+
+CMD ["/sbin/init"]

+ 38 - 0
docker-bake.hcl

@@ -0,0 +1,38 @@
+#variable "REPO" {
+#  default = "dockage/alpine"
+#}
+
+variable "ALPINE_VERSION" {
+  default = ""
+}
+
+#function "tag" {
+#  params = [tag]
+#  result = ["${REPO}:${tag}"]
+#}
+
+group "default" {
+  targets = ["base"]
+}
+
+target "base" {
+  context    = "${ALPINE_VERSION}/"
+  dockerfile = "${ALPINE_VERSION}/Dockerfile"
+  target     = "base"
+  # tags       = tag("${ALPINE_VERSION}")
+  platforms  = [
+    "linux/386",
+    "linux/amd64",
+    "linux/arm/v6",
+    "linux/arm/v7",
+    "linux/arm64/v8",
+    "linux/ppc64le",
+    "linux/s390x"
+  ]
+}
+
+target "openrc" {
+  inherits = ["base"]
+  target   = "openrc"
+  # tags     = tag("${ALPINE_VERSION}-openrc")
+}