Skip to content

Commit 6855e4f

Browse files
committed
build: refactor Dockerfile
1 parent a1c13f2 commit 6855e4f

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

installer-image/Dockerfile

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
# syntax=docker/dockerfile:1
22

3-
FROM octopusdeploy/dhi-golang:1.24-alpine3.23-dev AS go-build
3+
4+
FROM octopusdeploy/dhi-golang:1.25-debian13-dev AS build
5+
ARG TARGETARCH
6+
ARG CF_CLI_VERSION=v0.2.16
47
RUN go install github.com/davidrjonas/semver-cli@latest \
5-
&& cp $GOPATH/bin/semver-cli /usr/local/bin/
8+
&& cp $GOPATH/bin/semver-cli /tmp/semver-cli
9+
ADD --unpack=true --chown=nonroot:nonroot --chmod=755 https://github.com/codefresh-io/cli-v2/releases/download/${CF_CLI_VERSION}/cf-linux-${TARGETARCH}.tar.gz /tmp/cf/
10+
611

712
# DHI source: https://hub.docker.com/repository/docker/octopusdeploy/dhi-debian-base/customizations/8106437942896324135
8-
FROM octopusdeploy/dhi-debian-base:trixie_cf-gitops-runtime-installer-debian13
9-
ARG CF_CLI_VERSION=v0.2.16
13+
FROM octopusdeploy/dhi-debian-base:trixie_cf-gitops-runtime-installer-debian13 AS production
1014
ARG TARGETARCH
11-
ADD --unpack=true --chown=nonroot:nonroot --chmod=755 https://github.com/codefresh-io/cli-v2/releases/download/${CF_CLI_VERSION}/cf-linux-${TARGETARCH}.tar.gz /usr/local/bin/cf
12-
COPY --from=go-build --chown=nonroot:nonroot --chmod=755 /usr/local/bin/semver-cli /usr/local/bin/semver-cli
13-
USER nonroot
15+
COPY --from=build --chown=nonroot:nonroot --chmod=755 /tmp/cf/cf-linux-${TARGETARCH} /usr/local/bin/cf
16+
COPY --from=build --chown=nonroot:nonroot --chmod=755 /tmp/semver-cli /usr/local/bin/semver-cli
1417
WORKDIR /home/codefresh
18+
USER nonroot

0 commit comments

Comments
 (0)