1
0
mirror of https://github.com/Tecnativa/docker-socket-proxy synced 2024-12-21 14:18:07 +00:00

Fix build

- Update labels to match those from https://github.com/opencontainers/image-spec/blob/master/annotations.md#pre-defined-annotation-keys
- Add missing build args.
- Remove unneeded python (which was failing to install, BTW) from the image.
- Remove `hooks` folder, which was used to build the image automatically in the Docker Hub. It's done in GitHub Actions now.
This commit is contained in:
Jairo Llopis 2020-12-14 09:14:11 +00:00 committed by Jairo Llopis
parent 144ea28cf3
commit 74c627bb27
3 changed files with 14 additions and 53 deletions

View File

@ -29,6 +29,8 @@ jobs:
env:
DOCKER_REPO: tecnativa/docker-socket-proxy
steps:
- name: Get date
run: echo "BUILD_DATE=$(date --rfc-3339 ns)" >> $GITHUB_ENV
# Prepare Docker environment and build
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
@ -37,6 +39,9 @@ jobs:
- name: Build image(s)
uses: docker/build-push-action@v2
with:
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
VCS_REF=${{ github.sha }}
context: .
file: ./Dockerfile
# HACK: Build single platform image for testing. See https://github.com/docker/buildx/issues/59
@ -93,6 +98,9 @@ jobs:
'refs/heads/master'
uses: docker/build-push-action@v2
with:
build-args: |
BUILD_DATE=${{ env.BUILD_DATE }}
VCS_REF=${{ github.sha }}
context: .
file: ./Dockerfile
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm/v8,linux/arm64,linux/ppc64le,linux/s390x

View File

@ -1,5 +1,4 @@
ARG REPO=library
FROM ${REPO}/haproxy:1.9-alpine
FROM haproxy:1.9-alpine
EXPOSE 2375
ENV ALLOW_RESTARTS=0 \
@ -29,17 +28,11 @@ ENV ALLOW_RESTARTS=0 \
VOLUMES=0
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apk add --update --no-cache python3 && ln -sf $(which python3) /usr/local/bin/python
RUN python -m ensurepip && python -m pip install --no-cache --upgrade pip setuptools
# Metadata
ARG VCS_REF
ARG BUILD_DATE
LABEL org.label-schema.schema-version="1.0" \
org.label-schema.vendor=Tecnativa \
org.label-schema.license=Apache-2.0 \
org.label-schema.build-date="$BUILD_DATE" \
org.label-schema.vcs-ref="$VCS_REF" \
org.label-schema.vcs-url="https://github.com/Tecnativa/docker-socket-proxy"
LABEL org.opencontainers.image.vendor=Tecnativa \
org.opencontainers.image.licenses=Apache-2.0 \
org.opencontainers.image.created="$BUILD_DATE" \
org.opencontainers.image.revision="$VCS_REF" \
org.opencontainers.image.source="https://github.com/Tecnativa/docker-socket-proxy"

View File

@ -1,40 +0,0 @@
#!/bin/bash
set -ex
# Extract arch repo from a docker tag suffix
REPO=""
case "$DOCKER_TAG" in
*amd64)
REPO="library"
;;
*arm32v5)
REPO="arm32v5"
;;
*arm32v6)
REPO="arm32v6"
;;
*arm32v7)
REPO="arm32v7"
;;
*arm64v8)
REPO="arm64v8"
;;
*i386)
REPO="i386"
;;
*ppc64le)
REPO="ppc64le"
;;
*s390x)
REPO="s390x"
;;
*)
REPO="library"
;;
esac
docker build \
--build-arg REPO="$REPO" \
--build-arg VCS_REF="$GIT_SHA1" \
--build-arg BUILD_DATE="$(date --rfc-3339 ns)" \
--tag "$IMAGE_NAME" .