-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.source
31 lines (28 loc) · 1.24 KB
/
Dockerfile.source
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
FROM golang:1.21-bookworm AS build
ARG nomad_version=1.6.3
ARG nomad_prs=
ARG nomad_origin=https://github.com/hashicorp/nomad
WORKDIR /build
RUN apt-get update && apt-get -y install build-essential curl git
RUN git clone -b v${nomad_version} ${nomad_origin} . && \
git config --global user.email "build@localhost" && \
git config --global user.name "Nomad Build" && \
for p in ${nomad_prs} ; do curl -L ${nomad_origin}/pull/$p.patch | git am - ; done && \
echo "Doing build..." && \
go mod vendor && \
go build -o /nomad -tags ui .
FROM debian:bookworm-slim
ARG cni_version=1.3.0
WORKDIR /
COPY --from=build /nomad /usr/local/bin/nomad
RUN apt-get update && \
apt-get -y install curl unzip iptables iproute2 && \
curl -L -o cni-plugins.tgz https://github.com/containernetworking/plugins/releases/download/v${cni_version}/cni-plugins-linux-amd64-v${cni_version}.tgz && \
mkdir -p /usr/libexec/cni && \
tar -xvzf cni-plugins.tgz -C /usr/libexec/cni && \
rm cni-plugins.tgz && \
apt-get -y remove curl unzip && \
apt-get -y autoremove && \
rm -rf /var/cache/apt
LABEL org.opencontainers.image.source https://github.com/resinstack/nomad
ENTRYPOINT ["/usr/local/bin/nomad"]