-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: docker/Dockerfile to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-8235199 - https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-8235199
- Loading branch information
Showing
1 changed file
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# __ | ||
# .-----.-----.______.-----.----.-----.--.--.--.--.______.----.---.-.----| |--.-----. | ||
# | _ | _ |______| _ | _| _ |_ _| | |______| __| _ | __| | -__| | ||
# |___ |_____| | __|__| |_____|__.__|___ | |____|___._|____|__|__|_____| | ||
# |_____| |__| |_____| | ||
# | ||
# Copyright (c) 2023 Fabio Cicerchia. https://fabiocicerchia.it. MIT License | ||
# Repo: https://github.com/fabiocicerchia/go-proxy-cache | ||
|
||
FROM golang:1.20.1-alpine3.17 AS builder | ||
|
||
ARG BUILD_CMD=build | ||
|
||
WORKDIR /go/src/github.com/fabiocicerchia/go-proxy-cache | ||
|
||
ENV CGO_CFLAGS -march=native -O3 | ||
|
||
RUN apk update \ | ||
&& apk add --no-cache \ | ||
gcc \ | ||
libc-dev \ | ||
make | ||
|
||
COPY . ./ | ||
|
||
RUN make $BUILD_CMD | ||
|
||
FROM alpine:3.21.0 | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /go/src/github.com/fabiocicerchia/go-proxy-cache/go-proxy-cache /usr/local/bin/ | ||
COPY --from=builder /go/src/github.com/fabiocicerchia/go-proxy-cache/config.yml.dist /app/config.yml | ||
|
||
RUN apk upgrade | ||
|
||
RUN go-proxy-cache --version \ | ||
&& go-proxy-cache --test | ||
|
||
CMD ["go-proxy-cache"] |