Skip to content

Commit

Permalink
Updates Dockerfile to recompose layers; use modern install practices
Browse files Browse the repository at this point in the history
  • Loading branch information
Eagerod committed Feb 22, 2025
1 parent 822ab4d commit dae9f55
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COPY . .
RUN make test && make


FROM debian:10
FROM debian:12

RUN \
apt-get update && \
Expand All @@ -38,28 +38,39 @@ RUN \
software-properties-common && \
apt-get clean

# Kubectl
RUN curl -fsS https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list

# Packer
RUN curl -fsS https://apt.releases.hashicorp.com/gpg | apt-key add -
RUN apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"

# Docker
RUN curl -fsS https://download.docker.com/linux/debian/gpg | apt-key add -
RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

RUN \
install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && \
chmod a+r /etc/apt/keyrings/docker.asc && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" > /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-get install -y \
containerd.io \
docker-ce \
docker-ce-cli \
kubectl \
packer && \
containerd.io && \
apt-get clean

# Packer
RUN \
curl -fsS https://apt.releases.hashicorp.com/gpg | apt-key add - && \
apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
apt-get update && \
apt-get install -y packer && \
apt-get clean

# Kubectl
ARG KUBERNETES_VERSION=v1.32.1

RUN \
ARCH="amd64" && \
curl -fsSL "https://dl.k8s.io/release/${KUBERNETES_VERSION}/bin/linux/${ARCH}/kubectl" -o /usr/bin/kubectl && \
curl -fsSL "https://dl.k8s.io/release/${KUBERNETES_VERSION}/bin/linux/${ARCH}/kubeadm" -o /usr/bin/kubeadm && \
curl -fsSL "https://dl.k8s.io/release/${KUBERNETES_VERSION}/bin/linux/${ARCH}/kubelet" -o /usr/bin/kubelet && \
chmod +x /usr/bin/kubeadm /usr/bin/kubelet /usr/bin/kubectl

COPY --from=builder /app/build/hope /usr/bin/hope

VOLUME ["/src"]

0 comments on commit dae9f55

Please sign in to comment.