mirror of
https://github.com/nginx-proxy/docker-letsencrypt-nginx-proxy-companion
synced 2024-11-23 00:52:02 +01:00
Merge pull request #906 from nginx-proxy/docker-gen-from-image
Get the docker-gen binary from upstream docker image instead of building.
This commit is contained in:
commit
d3d0c36d69
42
.github/workflows/test.yml
vendored
42
.github/workflows/test.yml
vendored
@ -41,39 +41,12 @@ jobs:
|
||||
name: companion.tar
|
||||
path: companion.tar
|
||||
|
||||
nginx-proxy-pull:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v2
|
||||
- name: Pull nginx-proxy Image
|
||||
run: docker pull nginxproxy/nginx-proxy:latest
|
||||
- name: Pull docker-gen Image
|
||||
run: docker pull nginxproxy/docker-gen:latest
|
||||
- name: List Docker Images
|
||||
run: docker images
|
||||
- name: Export Images Artifacts
|
||||
run: |
|
||||
docker save nginxproxy/nginx-proxy:latest > nginx-proxy.tar
|
||||
docker save nginxproxy/docker-gen:latest > docker-gen.tar
|
||||
- name: Upload nginx-proxy Image Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nginx-proxy.tar
|
||||
path: nginx-proxy.tar
|
||||
- name: Upload docker-gen Image Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: docker-gen.tar
|
||||
path: docker-gen.tar
|
||||
|
||||
docker-specs-tests:
|
||||
needs: companion-build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
- name: Checkout Docker official images tests
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: docker-library/official-images
|
||||
@ -92,7 +65,6 @@ jobs:
|
||||
integration-tests:
|
||||
needs:
|
||||
- companion-build
|
||||
- nginx-proxy-pull
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -141,18 +113,6 @@ jobs:
|
||||
- name: Setup Boulder
|
||||
if: ${{ matrix.acme-ca == 'boulder' }}
|
||||
run: test/setup/setup-boulder.sh
|
||||
- name: Download nginx-proxy Image
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: nginx-proxy.tar
|
||||
- name: Download docker-gen Image
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: docker-gen.tar
|
||||
- name: Import nginx-proxy Images
|
||||
run: |
|
||||
docker load < nginx-proxy.tar
|
||||
docker load < docker-gen.tar
|
||||
- name: Setup nginx-proxy
|
||||
env:
|
||||
SETUP: ${{ matrix.setup }}
|
||||
|
21
Dockerfile
21
Dockerfile
@ -1,19 +1,4 @@
|
||||
FROM golang:1.17.6-alpine AS go-builder
|
||||
|
||||
ENV DOCKER_GEN_VERSION=0.8.0
|
||||
|
||||
# Build docker-gen
|
||||
RUN apk add --no-cache --virtual .build-deps git \
|
||||
&& git clone https://github.com/nginx-proxy/docker-gen \
|
||||
&& cd /go/docker-gen \
|
||||
&& git -c advice.detachedHead=false checkout $DOCKER_GEN_VERSION \
|
||||
&& go mod download \
|
||||
&& CGO_ENABLED=0 go build -ldflags "-X main.buildVersion=${VERSION}" -o docker-gen ./cmd/docker-gen \
|
||||
&& go clean -cache \
|
||||
&& mv docker-gen /usr/local/bin/ \
|
||||
&& cd - \
|
||||
&& rm -rf /go/docker-gen \
|
||||
&& apk del .build-deps
|
||||
FROM nginxproxy/docker-gen:0.8.0 AS docker-gen
|
||||
|
||||
FROM alpine:3.15.0
|
||||
|
||||
@ -33,8 +18,8 @@ RUN apk add --no-cache --virtual .bin-deps \
|
||||
openssl \
|
||||
socat
|
||||
|
||||
# Install docker-gen from build stage
|
||||
COPY --from=go-builder /usr/local/bin/docker-gen /usr/local/bin/
|
||||
# Install docker-gen from the nginxproxy/docker-gen image
|
||||
COPY --from=docker-gen /usr/local/bin/docker-gen /usr/local/bin/
|
||||
|
||||
# Install acme.sh
|
||||
COPY /install_acme.sh /app/install_acme.sh
|
||||
|
Loading…
Reference in New Issue
Block a user