Skip to content

Commit e22770f

Browse files
committed
build: refactor Dockerfile
1 parent 9558a48 commit e22770f

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

installer-image/Dockerfile

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
FROM octopusdeploy/dhi-golang:1.24-alpine3.23-dev AS go-build
1+
# syntax=docker/dockerfile:1
22

3+
FROM octopusdeploy/dhi-golang:1.24-alpine3.23-dev AS go-build
34
RUN go install github.com/davidrjonas/semver-cli@latest \
45
&& cp $GOPATH/bin/semver-cli /usr/local/bin/
56

6-
#bookworm-slim
7+
# DHI source: https://hub.docker.com/repository/docker/octopusdeploy/dhi-debian-base/customizations/-1316986597936591264
78
FROM octopusdeploy/dhi-debian-base:trixie_cf-gitops-runtime-installer-debian-13
8-
9-
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
10-
119
ARG CF_CLI_VERSION=v0.2.16
1210
ARG TARGETARCH
13-
14-
RUN curl -L --output - https://github.com/codefresh-io/cli-v2/releases/download/${CF_CLI_VERSION}/cf-linux-${TARGETARCH}.tar.gz | tar zx && mv ./cf-linux-${TARGETARCH} /usr/local/bin/cf
15-
COPY --from=go-build /usr/local/bin/semver-cli /usr/local/bin/semver-cli
16-
17-
COPY --from=bitnamilegacy/kubectl:1.33.4 /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/
18-
19-
RUN useradd -m -s /bin/bash codefresh
20-
USER codefresh
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
2114
WORKDIR /home/codefresh

0 commit comments

Comments
 (0)