Remove -mod=readonly from the helloworld's Dockerfile (#1017)

The go.mod file was removed in
4ea31c444a
, and breaks building using Tekton.

The error is as follows:
STEP 3: COPY ./test/test_images/helloworld/ .
STEP 4: RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o server
build flag -mod=readonly only valid when using modules
subprocess exited with status 1
subprocess exited with status 1
error building at STEP "RUN CGO_ENABLED=0 GOOS=linux go build
-mod=readonly -v -o server": exit status 1
This commit is contained in:
Martin Gencur 2020-09-18 01:03:44 +02:00 committed by GitHub
parent 043c3b9e87
commit 1607bf8c0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -10,8 +10,7 @@ WORKDIR /app
COPY ./test/test_images/helloworld/ . COPY ./test/test_images/helloworld/ .
# Build the binary. # Build the binary.
# -mod=readonly ensures immutable go.mod and go.sum in container builds. RUN CGO_ENABLED=0 GOOS=linux go build -v -o server
RUN CGO_ENABLED=0 GOOS=linux go build -mod=readonly -v -o server
# Use the official Alpine image for a lean production container. # Use the official Alpine image for a lean production container.
# https://hub.docker.com/_/alpine # https://hub.docker.com/_/alpine