Skip to content

Commit 74c627b

Browse files
Jairo Llopisyajo
authored andcommitted
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.
1 parent 144ea28 commit 74c627b

File tree

3 files changed

+14
-53
lines changed

3 files changed

+14
-53
lines changed

.github/workflows/test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
env:
3030
DOCKER_REPO: tecnativa/docker-socket-proxy
3131
steps:
32+
- name: Get date
33+
run: echo "BUILD_DATE=$(date --rfc-3339 ns)" >> $GITHUB_ENV
3234
# Prepare Docker environment and build
3335
- uses: actions/checkout@v2
3436
- uses: docker/setup-qemu-action@v1
@@ -37,6 +39,9 @@ jobs:
3739
- name: Build image(s)
3840
uses: docker/build-push-action@v2
3941
with:
42+
build-args: |
43+
BUILD_DATE=${{ env.BUILD_DATE }}
44+
VCS_REF=${{ github.sha }}
4045
context: .
4146
file: ./Dockerfile
4247
# HACK: Build single platform image for testing. See https://github.com/docker/buildx/issues/59
@@ -93,6 +98,9 @@ jobs:
9398
'refs/heads/master'
9499
uses: docker/build-push-action@v2
95100
with:
101+
build-args: |
102+
BUILD_DATE=${{ env.BUILD_DATE }}
103+
VCS_REF=${{ github.sha }}
96104
context: .
97105
file: ./Dockerfile
98106
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm/v8,linux/arm64,linux/ppc64le,linux/s390x

Dockerfile

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
ARG REPO=library
2-
FROM ${REPO}/haproxy:1.9-alpine
1+
FROM haproxy:1.9-alpine
32

43
EXPOSE 2375
54
ENV ALLOW_RESTARTS=0 \
@@ -29,17 +28,11 @@ ENV ALLOW_RESTARTS=0 \
2928
VOLUMES=0
3029
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
3130

32-
# Install python/pip
33-
ENV PYTHONUNBUFFERED=1
34-
RUN apk add --update --no-cache python3 && ln -sf $(which python3) /usr/local/bin/python
35-
RUN python -m ensurepip && python -m pip install --no-cache --upgrade pip setuptools
36-
3731
# Metadata
3832
ARG VCS_REF
3933
ARG BUILD_DATE
40-
LABEL org.label-schema.schema-version="1.0" \
41-
org.label-schema.vendor=Tecnativa \
42-
org.label-schema.license=Apache-2.0 \
43-
org.label-schema.build-date="$BUILD_DATE" \
44-
org.label-schema.vcs-ref="$VCS_REF" \
45-
org.label-schema.vcs-url="https://github.com/Tecnativa/docker-socket-proxy"
34+
LABEL org.opencontainers.image.vendor=Tecnativa \
35+
org.opencontainers.image.licenses=Apache-2.0 \
36+
org.opencontainers.image.created="$BUILD_DATE" \
37+
org.opencontainers.image.revision="$VCS_REF" \
38+
org.opencontainers.image.source="https://github.com/Tecnativa/docker-socket-proxy"

hooks/build

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)