GeezerVison is showing github.com — re-worked and tested quite some samples · norman465/CodeEngine@f3f2d05
File tree
Expand file treeCollapse file tree
Open diff view settings
helloworld-samples/function-codebundle-nodejs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss bannerExpand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: app-n-job/Dockerfile -8Lines changed: 0 additions & 8 deletions Collapse file
Copy file name to clipboardExpand all lines: app-n-job/README.md -16Lines changed: 0 additions & 16 deletions Collapse file
Copy file name to clipboardExpand all lines: app-n-job/app-n-job.go -25Lines changed: 0 additions & 25 deletions Collapse file
Copy file name to clipboardExpand all lines: app-n-job/build -19Lines changed: 0 additions & 19 deletions Collapse file
Copy file name to clipboardExpand all lines: app-n-job/run -52Lines changed: 0 additions & 52 deletions Collapse file
Copy file name to clipboard +8-6Lines changed: 8 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -FROM icr.io/codeengine/golang:alpine |
2 | | -COPY app.go / |
3 | | -RUN go build -o /app /app.go |
| 1 | +FROM quay.io/projectquay/golang:1.22 AS build-env |
| 2 | +WORKDIR /go/src/app |
| 3 | +COPY app.go . |
| 4 | + |
| 5 | +RUN CGO_ENABLED=0 go build -o /go/bin/app app.go |
4 | 6 |
|
5 | 7 | # Copy the exe into a smaller base image |
6 | | -FROM icr.io/codeengine/alpine |
7 | | -COPY --from=0 /app /app |
8 | | -CMD /app |
| 8 | +FROM gcr.io/distroless/static-debian12 |
| 9 | +COPY --from=build-env /go/bin/app / |
| 10 | +CMD ["/app"] |
Collapse file
Copy file name to clipboard +8-6Lines changed: 8 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | | -FROM icr.io/codeengine/golang:alpine |
2 | | -COPY job.go / |
3 | | -RUN go build -o /job /job.go |
| 1 | +FROM quay.io/projectquay/golang:1.22 AS build-env |
| 2 | +WORKDIR /go/src/app |
| 3 | +COPY job.go . |
| 4 | + |
| 5 | +RUN CGO_ENABLED=0 go build -o /go/bin/job job.go |
4 | 6 |
|
5 | 7 | # Copy the exe into a smaller base image |
6 | | -FROM icr.io/codeengine/alpine |
7 | | -COPY --from=0 /job /job |
8 | | -CMD /job |
| 8 | +FROM gcr.io/distroless/static-debian12 |
| 9 | +COPY --from=build-env /go/bin/job / |
| 10 | +CMD ["/job"] |
Collapse file
Copy file name to clipboardExpand all lines: app2job/run +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -23,13 +23,13 @@ export REGISTRY=${REGISTRY:-icr.io/codeengine} |
23 | 23 | export COUNT=${COUNT:-50} |
24 | 24 |
|
25 | 25 | # Create the app |
26 | | -ibmcloud ce app create -n a2j-app --image ${REGISTRY}/a2j-app |
| 26 | +ibmcloud ce app create -n a2j-app --cpu .125 --memory 0.25G --image ${REGISTRY}/a2j-app |
27 | 27 |
|
28 | 28 | # Get metadata about the app for later use |
29 | 29 | URL=$(ibmcloud ce app get -n a2j-app -o url) |
30 | 30 |
|
31 | 31 | # Create the job definition |
32 | | -ibmcloud ce job create -n a2j-job --ai=1-${COUNT} --image ${REGISTRY}/a2j-job |
| 32 | +ibmcloud ce job create -n a2j-job --ai=1-${COUNT} --cpu .125 --memory 0.25G --image ${REGISTRY}/a2j-job |
33 | 33 |
|
34 | 34 | # Now, curl the app and see if it creates the job |
35 | 35 | curl -fs ${URL}/a2j-job -X PUT | tee out |
|
Collapse file
Copy file name to clipboardExpand all lines: bash/Dockerfile -25Lines changed: 0 additions & 25 deletions Collapse file
Copy file name to clipboardExpand all lines: bash/README.md -39Lines changed: 0 additions & 39 deletions