-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.nomad
37 lines (28 loc) · 966 Bytes
/
Dockerfile.nomad
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
# Use Fedora 35 as the base image
FROM registry.fedoraproject.org/fedora:38
# Add HashiCorp Fedora YUM repository
ADD https://rpm.releases.hashicorp.com/fedora/hashicorp.repo /etc/yum.repos.d/
# Use fastest mirror available
RUN echo "fastestmirror=True" >> /etc/dnf/dnf.conf
# Install Consul and systemd (required for the init inside container)
RUN dnf install -y consul \
nomad \
systemd \
tcpdump \
iproute \
bind-utils \
less \
jq \
procps-ng \
iptables \
iputils && \
dnf clean all
# Install CNI Plugins
RUN curl -L -o cni-plugins.tgz "https://github.com/containernetworking/plugins/releases/download/v1.0.0/cni-plugins-linux-$( [ $(uname -m) = aarch64 ] && echo arm64 || echo amd64)"-v1.0.0.tgz && \
mkdir -p /opt/cni/bin && \
tar -C /opt/cni/bin -xzf cni-plugins.tgz
# Enable Consul and Nomad
RUN systemctl enable consul \
nomad
# Use systemd as command
CMD ["/usr/sbin/init"]