forked from multani/docker-nomad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
58 lines (47 loc) · 2.28 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
50
51
52
53
54
55
56
57
58
FROM alpine:3.17.2
SHELL ["/bin/ash", "-x", "-c", "-o", "pipefail"]
# Based on https://github.com/djenriquez/nomad
LABEL maintainer="Jonathan Ballet <[email protected]>"
RUN addgroup nomad \
&& adduser -S -G nomad nomad \
&& mkdir -p /nomad/data \
&& mkdir -p /etc/nomad \
&& chown -R nomad:nomad /nomad /etc/nomad
# Allow to fetch artifacts from TLS endpoint during the builds and by Nomad after.
# Install timezone data so we can run Nomad periodic jobs containing timezone information
RUN apk --update --no-cache add \
ca-certificates \
dumb-init \
libcap \
tzdata \
su-exec \
&& update-ca-certificates
# https://github.com/sgerrand/alpine-pkg-glibc/releases
ARG GLIBC_VERSION=2.34-r0
ADD https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub /etc/apk/keys/sgerrand.rsa.pub
ADD https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk \
glibc.apk
RUN apk add --no-cache --force-overwrite \
glibc.apk \
&& rm glibc.apk
# https://releases.hashicorp.com/nomad/
ARG NOMAD_VERSION=1.5.0
ADD https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_amd64.zip \
nomad_${NOMAD_VERSION}_linux_amd64.zip
ADD https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_SHA256SUMS \
nomad_${NOMAD_VERSION}_SHA256SUMS
ADD https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_SHA256SUMS.sig \
nomad_${NOMAD_VERSION}_SHA256SUMS.sig
RUN apk add --no-cache --virtual .nomad-deps gnupg \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& gpg --keyserver pgp.mit.edu --keyserver keys.openpgp.org --keyserver keyserver.ubuntu.com --recv-keys "C874 011F 0AB4 0511 0D02 1055 3436 5D94 72D7 468F" \
&& gpg --batch --verify nomad_${NOMAD_VERSION}_SHA256SUMS.sig nomad_${NOMAD_VERSION}_SHA256SUMS \
&& grep nomad_${NOMAD_VERSION}_linux_amd64.zip nomad_${NOMAD_VERSION}_SHA256SUMS | sha256sum -c \
&& unzip -d /bin nomad_${NOMAD_VERSION}_linux_amd64.zip \
&& chmod +x /bin/nomad \
&& rm -rf "$GNUPGHOME" nomad_${NOMAD_VERSION}_linux_amd64.zip nomad_${NOMAD_VERSION}_SHA256SUMS nomad_${NOMAD_VERSION}_SHA256SUMS.sig \
&& apk del .nomad-deps
EXPOSE 4646 4647 4648 4648/udp
COPY start.sh /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/start.sh"]