Updates the Dockerfile to use uppercase for multi-stage build
definitions. This change enhances readability and maintains consistency
across the build stages, ensuring alignment with common best practices in
Dockerfile conventions.
Add ARG directives for TARGETOS and TARGETARCH to enable
multi-architecture support. Modify the build command to
use the specified target OS and architecture for more
flexible and portable builds. Ensure compatibility
with different deployment environments.
RUNif[$(go mod tidy -v 2>&1| grep -c unused) !=0];thenecho"Unused modules, please run 'go mod tidy'";exit 1;fi
@@ -14,9 +17,9 @@ RUN ["/bin/bash", "-c", "cat coverage.txt.tmp | grep -v -f <(find . -type f | xa
RUN go tool cover -html=coverage.txt -o coverage.html
RUN go tool cover -func=coverage.txt
RUN rm coverage.txt.tmp
RUNGOOS=linux GOARCH=amd64CGO_ENABLED=0 go build -mod=readonly -o release/default-request-adder -ldflags '-w -s'
RUNGOOS=${TARGETOS}GOARCH=${TARGETARCH}CGO_ENABLED=0 go build -mod=readonly -o release/default-request-adder -ldflags '-w -s'
FROMscratchasexport
FROMscratchASexport
COPY --from=build /build/coverage.txt /
FROMscratch
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.