Skip to content

Commit

Permalink
fix: docker/Dockerfile to reduce vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
snyk-bot committed Dec 12, 2024
1 parent 4f5a4d8 commit 8554b91
Showing 1 changed file with 40 additions and 1 deletion.
1 change: 0 additions & 1 deletion docker/Dockerfile

This file was deleted.

40 changes: 40 additions & 0 deletions docker/Dockerfile
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"]

0 comments on commit 8554b91

Please sign in to comment.