From da0e674f137019f7fce8de19587eac11831be4b4 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Sun, 19 May 2024 22:43:29 +0000 Subject: [PATCH] fix: docker/Dockerfile to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-6593966 - https://snyk.io/vuln/SNYK-ALPINE317-OPENSSL-6593966 --- docker/Dockerfile | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) mode change 120000 => 100644 docker/Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 120000 index 45cc04d..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -Dockerfile.alpine \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..6775e53 --- /dev/null +++ b/docker/Dockerfile @@ -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.18.6 + +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"]