-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.alpine-3.16
86 lines (70 loc) · 2.58 KB
/
Dockerfile.alpine-3.16
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
### Builder Go ###
FROM golang:1.19-alpine3.16 as builder-go
WORKDIR /go/src/app
ENV GIN_MODE=release
ENV GOPATH=/go
RUN apk add --no-cache \
build-base \
git \
curl \
make \
bash
COPY src /go/src/app
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 \
cd /go/src/app && \
go build -mod=readonly -ldflags="-s -w" -o goapp
### Binary ###
# FROM golang:${GOLANG_VERSION:-1.19.5-alpine3.16}
FROM nginx:${NGINX_VERSION:-1.23-alpine}
ARG BUILD_DATE
ARG BUILD_VERSION
ARG GIT_COMMIT
ARG GIT_URL
ENV VENDOR="DevOpsCornerId"
ENV AUTHOR="DevOpsCorner.id <[email protected]>"
ENV IMG_NAME="alpine"
ENV IMG_VERSION="3.16"
ENV IMG_DESC="Docker GO App Alpine 3.16"
ENV IMG_ARCH="amd64/x86_64"
ENV ALPINE_VERSION="3.16"
LABEL maintainer="$AUTHOR" \
architecture="$IMG_ARCH" \
ubuntu-version="$ALPINE_VERSION" \
org.label-schema.build-date="$BUILD_DATE" \
org.label-schema.name="$IMG_NAME" \
org.label-schema.description="$IMG_DESC" \
org.label-schema.vcs-ref="$GIT_COMMIT" \
org.label-schema.vcs-url="$GIT_URL" \
org.label-schema.vendor="$VENDOR" \
org.label-schema.version="$BUILD_VERSION" \
org.label-schema.schema-version="$IMG_VERSION" \
org.opencontainers.image.authors="$AUTHOR" \
org.opencontainers.image.description="$IMG_DESC" \
org.opencontainers.image.vendor="$VENDOR" \
org.opencontainers.image.version="$IMG_VERSION" \
org.opencontainers.image.revision="$GIT_COMMIT" \
org.opencontainers.image.created="$BUILD_DATE" \
fr.hbis.docker.base.build-date="$BUILD_DATE" \
fr.hbis.docker.base.name="$IMG_NAME" \
fr.hbis.docker.base.vendor="$VENDOR" \
fr.hbis.docker.base.version="$BUILD_VERSION"
ENV GIN_MODE=release
RUN apk add --no-cache \
build-base \
git \
curl \
make \
bash \
nano
# COPY --from=alpine/k8s:1.26.2 /usr/local/bin/ /usr/local/bin/
# COPY --from=devopscorner/aws-cli:latest /usr/local/aws-cli/ /usr/local/aws-cli/
# COPY --from=devopscorner/aws-cli:latest /aws-cli-bin/ /usr/local/bin/
COPY --from=devopscorner/cicd:alpine /root/.tfenv /root/.tfenv
COPY --from=devopscorner/cicd:alpine /usr/local/bin/ /usr/local/bin/
COPY --from=devopscorner/cicd:alpine /usr/local/aws-cli/ /usr/local/aws-cli/
COPY --from=builder-go /go/src/app/goapp /usr/local/bin/k8s-context
COPY --from=builder-go /go/src/app/goapp /usr/local/bin/kc
COPY --from=builder-go /go/src/app/goapp /usr/local/bin/k8c
EXPOSE 22 80 443
STOPSIGNAL SIGQUIT
CMD ["nginx", "-g", "daemon off;"]