Skip to content

Commit 7ddab05

Browse files
committed
adjust helloworld dockerfile
1 parent 18beb79 commit 7ddab05

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

helloworld/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
FROM icr.io/codeengine/golang:alpine
2-
RUN apk -U upgrade
3-
COPY helloworld.go /
4-
RUN go build -ldflags '-s -w -extldflags "-static"' -o /helloworld /helloworld.go
1+
FROM quay.io/app-sre/ubi8-go-toolset AS build-env
2+
COPY helloworld.go .
3+
RUN CGO_ENABLED=0 go build -o /opt/app-root/src/app helloworld.go
54

65
# Copy the exe into a smaller base image
7-
FROM icr.io/codeengine/alpine
8-
RUN apk -U upgrade
9-
COPY --from=0 /helloworld /helloworld
10-
CMD /helloworld
6+
FROM registry.access.redhat.com/ubi9-minimal:latest
7+
COPY --from=build-env /opt/app-root/src/app /
8+
CMD ["/app"]

0 commit comments

Comments
 (0)