-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_ping
82 lines (75 loc) · 2.11 KB
/
Dockerfile_ping
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
# syntax=docker/dockerfile:1.1.7-experimental
########################
# Alpine builder image #
########################
FROM golang:1.19.1-alpine3.16 AS build
# Checkout
RUN apk add --no-cache \
bash \
git openssh-client \
&& mkdir -p /build \
&& cd /build \
&& git clone https://github.com/layeh/gumble.git \
&& cd gumble \
&& true
# This arg is any valid git reference
# pragma: allowlist nextline secret
ARG GUMBLE_VERSION="146f9205029b73783dbd79043c4fc5247d8c425d"
# Build
RUN cd /build/gumble \
&& git checkout $GUMBLE_VERSION \
&& go build -v -o /build/mumble-ping -buildmode=exe cmd/mumble-ping/main.go \
&& /build/mumble-ping --help \
&& true
#####################
# Alpine ping image #
#####################
FROM alpine:3.16 as ping
COPY --from=build /build/mumble-ping /bin/mumble-ping
COPY ./docker/entrypoint-ping.sh /entrypoint.sh
RUN apk add --no-cache \
bash \
coreutils \
&& true
SHELL ["/bin/bash", "-lc"]
ENTRYPOINT ["/entrypoint.sh"]
########################
# Debian builder image #
########################
FROM golang:1.19.1-bullseye AS debianbuild
ENV \
# locale
LC_ALL=C.UTF-8 \
# python:
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
# pip:
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
# debconf
DEBIAN_FRONTEND=noninteractive
# Checkout
RUN mkdir -p /build \
&& cd /build \
&& git clone https://github.com/layeh/gumble.git \
&& cd gumble \
&& true
# This arg is any valid git reference
# pragma: allowlist nextline secret
ARG GUMBLE_VERSION="146f9205029b73783dbd79043c4fc5247d8c425d"
# Build
RUN cd /build/gumble \
&& git checkout $GUMBLE_VERSION \
&& go build -v -o /build/mumble-ping -buildmode=pie cmd/mumble-ping/main.go \
&& /build/mumble-ping --help \
&& true
#####################
# Debian ping image #
#####################
FROM debian:bullseye-slim as debianping
COPY --from=debianbuild /build/mumble-ping /bin/mumble-ping
COPY ./docker/entrypoint-ping.sh /entrypoint.sh
SHELL ["/bin/bash", "-lc"]
ENTRYPOINT ["/entrypoint.sh"]