-
Notifications
You must be signed in to change notification settings - Fork 230
/
Dockerfile
49 lines (36 loc) · 1.52 KB
/
Dockerfile
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
FROM golang:1.23-alpine3.19@sha256:f6392ffebb028fed5ffe743ddb9716e38402c978779edd66474bb5d05f5e65e4 AS builder
LABEL "com.github.actions.icon"="bell"
LABEL "com.github.actions.color"="yellow"
LABEL "com.github.actions.name"="Slack Notify"
LABEL "com.github.actions.description"="This action will send notification to Slack"
LABEL "org.opencontainers.image.source"="https://github.com/rtCamp/action-slack-notify"
WORKDIR ${GOPATH}/src/github.com/rtcamp/action-slack-notify
COPY main.go ${GOPATH}/src/github.com/rtcamp/action-slack-notify
ENV CGO_ENABLED 0
ENV GOOS linux
RUN go build -a -installsuffix cgo -ldflags '-w -extldflags "-static"' -o /go/bin/slack-notify main.go
# alpine:latest as of 2024-03-11
FROM alpine@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d
COPY --from=builder /go/bin/slack-notify /usr/bin/slack-notify
ENV VAULT_VERSION 1.0.2
RUN apk update \
&& apk upgrade \
&& apk add \
bash \
jq \
ca-certificates \
python3 \
py3-pip \
rsync \
&& python3 -m pip install --break-system-packages shyaml \
&& rm -rf /var/cache/apk/*
# Setup Vault
RUN wget https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip && \
unzip vault_${VAULT_VERSION}_linux_amd64.zip && \
rm vault_${VAULT_VERSION}_linux_amd64.zip && \
mv vault /usr/local/bin/vault
# fix the missing dependency - https://stackoverflow.com/a/35613430
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
COPY *.sh /
RUN chmod +x /*.sh
ENTRYPOINT ["/entrypoint.sh"]