Skip to content

Commit

Permalink
ditto
Browse files Browse the repository at this point in the history
  • Loading branch information
EvgenyGri committed Sep 4, 2024
1 parent 990e296 commit c08121e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Dockerfile.goose
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ARG GO_VER="1.22"
ARG ALPINE_VER="3.20"
ARG ALPINE_MIRROR="https://mirror.yandex.ru/mirrors/alpine/v${ALPINE_VER}/main/"

# first build stage
# by default uses alpine-based image
Expand All @@ -10,8 +9,8 @@ FROM golang:${GO_VER}-alpine${ALPINE_VER} AS builder
WORKDIR /src

# install updates and build executable
RUN apk update --no-cache -X ${ALPINE_MIRROR}
RUN apk upgrade --no-cache -X ${ALPINE_MIRROR}
RUN apk update --no-cache -X https://mirror.yandex.ru/mirrors/alpine/v${ALPINE_VER}/main
RUN apk upgrade --no-cache -X https://mirror.yandex.ru/mirrors/alpine/v${ALPINE_VER}/main
RUN apk add make git

COPY . .
Expand All @@ -21,13 +20,12 @@ RUN make .install-goose
# second release stage
FROM alpine:${ALPINE_VER}
ARG ALPINE_VER
ARG ALPINE_MIRROR

# create user other than root and install updated
RUN addgroup -g 101 app && \
adduser -H -u 101 -G app -s /bin/sh -D app && \
apk update --no-cache -X ${ALPINE_MIRROR} && \
apk upgrade --no-cache -X ${ALPINE_MIRROR}
apk update --no-cache -X https://mirror.yandex.ru/mirrors/alpine/v${ALPINE_VER}/main && \
apk upgrade --no-cache -X https://mirror.yandex.ru/mirrors/alpine/v${ALPINE_VER}/main

# place all necessary executables and other files into /app directory
WORKDIR /app/
Expand Down

0 comments on commit c08121e

Please sign in to comment.