File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1
- FROM icr.io/codeengine/golang:alpine
2
- COPY secret.go /
3
- RUN go build -o /secret /secret.go
1
+ FROM quay.io/projectquay/golang:1.22 AS build-env
2
+ WORKDIR /go/src/app
3
+ COPY . .
4
+
5
+ RUN CGO_ENABLED=0 go build -o /go/bin/app secret.go
4
6
5
7
# Copy the exe into a smaller base image
6
- FROM icr .io/codeengine/alpine
7
- COPY --from=0 /secret /secret
8
- CMD /secret
8
+ FROM gcr .io/distroless/static-debian12
9
+ COPY --from=build-env /go/bin/app /
10
+ CMD [ "/app" ]
Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ ibmcloud ce secret create --name sec-secret-vol \
32
32
--from-file MY_FILE=file
33
33
34
34
# Create the app
35
- ibmcloud ce app create -n sec-app-vol --image ${REGISTRY} /ce-secret-vol \
36
- --mount-secret /mysecrets=sec-secret-vol
35
+ ibmcloud ce app create -n sec-app-vol --image ${REGISTRY} /ce-secret-vol --mount-secret /mysecrets=sec-secret-vol --cpu 0.125 --memory 0.5G
37
36
38
37
# Get the URL of the app for later use
39
38
URL=$( ibmcloud ce app get -n sec-app-vol -o url)
@@ -47,14 +46,15 @@ echo Instance name: $name
47
46
48
47
# Now check the logs to see if the env vars were set
49
48
ibmcloud ce app logs --instance $name | tee out
49
+ [[ " ${PIPESTATUS[0]} " == " 0" ]]
50
50
grep MY_ out
51
- if ! [[ $( grep MY_ out | wc -l) == " 4 " ]] ; then
51
+ if (( $(grep MY_ out | wc - l) != 4 )) ; then
52
52
echo " Unexpected output"
53
53
exit 1
54
54
fi
55
55
56
56
# Check to see if the context of "file" are assign to the "file" env var.
57
- if ! [[ $( grep ' ^file: In Congress' out | wc -l) == " 1 " ]] ; then
57
+ if (( $(grep '^file: In Congress' out | wc - l) != 1 )) ; then
58
58
echo " Unexpected output"
59
59
exit 1
60
60
fi
You can’t perform that action at this time.
0 commit comments