File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ jobs:
137137 echo ${{ toJSON(steps.sysdig.outputs.violation_report) }} | \
138138 jq -r .
139139 echo ${{ toJSON(steps.sysdig.outputs.violation_report) }} | \
140- jq -r .cis_docker_benchmark_violation_report[].violations[] | \
140+ jq -r ' .cis_docker_benchmark_violation_report[] | select(true) | .violations[]' | \
141141 wc -l | \
142142 xargs -I% test 0 -eq %
143143
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ FROM golang:1.20-alpine AS base
22
33RUN set -eux \
44 && apk --no-cache add ca-certificates \
5- && apk --no-cache add --virtual build-dependencies cmake g++ make unzip curl git
5+ && apk --no-cache add --virtual build-dependencies cmake g++ make unzip curl git libcap
66
77WORKDIR ${GOPATH}/src/github.com/AthenZ/garm
88
@@ -32,6 +32,9 @@ RUN BUILD_TIME=$(date -u +%Y%m%d-%H%M%S) \
3232 go build -ldflags "-s -w -linkmode 'external' -extldflags '-static -fPIC -m64 -pthread -std=c++11 -lstdc++' -X 'main.Version=${APP_VERSION} at ${BUILD_TIME} by ${GO_VERSION}'" -a -tags "cgo netgo" -installsuffix "cgo netgo" -o "${APP_NAME}" \
3333 && mv "${APP_NAME}" "/usr/bin/${APP_NAME}"
3434
35+ # allow well-known port binding
36+ RUN setcap 'cap_net_bind_service=+ep' "/usr/bin/${APP_NAME}"
37+
3538RUN apk del build-dependencies --purge \
3639 && rm -rf "${GOPATH}"
3740
@@ -50,7 +53,7 @@ COPY --from=builder /etc/passwd /etc/passwd
5053COPY --from=builder /usr/bin/${APP_NAME} /go/bin/${APP_NAME}
5154# Copy user
5255COPY --from=builder /etc/passwd /etc/passwd
53- # USER ${APP_NAME}
56+ USER ${APP_NAME}
5457
5558HEALTHCHECK NONE
5659ENTRYPOINT ["/go/bin/garm" ]
You can’t perform that action at this time.
0 commit comments