Skip to content

Commit d3d0c36

Browse files
authored
Merge pull request #906 from nginx-proxy/docker-gen-from-image
Get the docker-gen binary from upstream docker image instead of building.
2 parents 53798f6 + 3336e69 commit d3d0c36

File tree

2 files changed

+4
-59
lines changed

2 files changed

+4
-59
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -41,39 +41,12 @@ jobs:
4141
name: companion.tar
4242
path: companion.tar
4343

44-
nginx-proxy-pull:
45-
runs-on: ubuntu-latest
46-
47-
steps:
48-
- name: Checkout Code
49-
uses: actions/checkout@v2
50-
- name: Pull nginx-proxy Image
51-
run: docker pull nginxproxy/nginx-proxy:latest
52-
- name: Pull docker-gen Image
53-
run: docker pull nginxproxy/docker-gen:latest
54-
- name: List Docker Images
55-
run: docker images
56-
- name: Export Images Artifacts
57-
run: |
58-
docker save nginxproxy/nginx-proxy:latest > nginx-proxy.tar
59-
docker save nginxproxy/docker-gen:latest > docker-gen.tar
60-
- name: Upload nginx-proxy Image Artifact
61-
uses: actions/upload-artifact@v2
62-
with:
63-
name: nginx-proxy.tar
64-
path: nginx-proxy.tar
65-
- name: Upload docker-gen Image Artifact
66-
uses: actions/upload-artifact@v2
67-
with:
68-
name: docker-gen.tar
69-
path: docker-gen.tar
70-
7144
docker-specs-tests:
7245
needs: companion-build
7346
runs-on: ubuntu-latest
7447

7548
steps:
76-
- name: Checkout Code
49+
- name: Checkout Docker official images tests
7750
uses: actions/checkout@v2
7851
with:
7952
repository: docker-library/official-images
@@ -92,7 +65,6 @@ jobs:
9265
integration-tests:
9366
needs:
9467
- companion-build
95-
- nginx-proxy-pull
9668
strategy:
9769
fail-fast: false
9870
matrix:
@@ -141,18 +113,6 @@ jobs:
141113
- name: Setup Boulder
142114
if: ${{ matrix.acme-ca == 'boulder' }}
143115
run: test/setup/setup-boulder.sh
144-
- name: Download nginx-proxy Image
145-
uses: actions/download-artifact@v2
146-
with:
147-
name: nginx-proxy.tar
148-
- name: Download docker-gen Image
149-
uses: actions/download-artifact@v2
150-
with:
151-
name: docker-gen.tar
152-
- name: Import nginx-proxy Images
153-
run: |
154-
docker load < nginx-proxy.tar
155-
docker load < docker-gen.tar
156116
- name: Setup nginx-proxy
157117
env:
158118
SETUP: ${{ matrix.setup }}

Dockerfile

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
1-
FROM golang:1.17.6-alpine AS go-builder
2-
3-
ENV DOCKER_GEN_VERSION=0.8.0
4-
5-
# Build docker-gen
6-
RUN apk add --no-cache --virtual .build-deps git \
7-
&& git clone https://github.com/nginx-proxy/docker-gen \
8-
&& cd /go/docker-gen \
9-
&& git -c advice.detachedHead=false checkout $DOCKER_GEN_VERSION \
10-
&& go mod download \
11-
&& CGO_ENABLED=0 go build -ldflags "-X main.buildVersion=${VERSION}" -o docker-gen ./cmd/docker-gen \
12-
&& go clean -cache \
13-
&& mv docker-gen /usr/local/bin/ \
14-
&& cd - \
15-
&& rm -rf /go/docker-gen \
16-
&& apk del .build-deps
1+
FROM nginxproxy/docker-gen:0.8.0 AS docker-gen
172

183
FROM alpine:3.15.0
194

@@ -33,8 +18,8 @@ RUN apk add --no-cache --virtual .bin-deps \
3318
openssl \
3419
socat
3520

36-
# Install docker-gen from build stage
37-
COPY --from=go-builder /usr/local/bin/docker-gen /usr/local/bin/
21+
# Install docker-gen from the nginxproxy/docker-gen image
22+
COPY --from=docker-gen /usr/local/bin/docker-gen /usr/local/bin/
3823

3924
# Install acme.sh
4025
COPY /install_acme.sh /app/install_acme.sh

0 commit comments

Comments
 (0)