Skip to content

Commit

Permalink
image debug
Browse files Browse the repository at this point in the history
  • Loading branch information
DanRunfola committed Dec 10, 2024
1 parent 831a41d commit 3c95150
Showing 1 changed file with 6 additions and 37 deletions.
43 changes: 6 additions & 37 deletions geoBoundaryBuilder/images/k8s_worker.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,40 +1,9 @@
# Start from the Prefect image
FROM prefecthq/prefect:3.1.6.dev6-python3.12-kubernetes

# Install Docker
USER root

# Install system dependencies and Docker
RUN apt-get update && \
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release \
sudo \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | tee /etc/apt/trusted.gpg.d/docker.asc \
&& echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list \
&& apt-get update && apt-get install -y \
docker-ce-cli \
docker-ce \
docker-compose \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Set up Docker group
RUN groupadd docker && usermod -aG docker $USER

# Configure the user to have permission to run Docker commands
RUN mkdir /etc/sudoers.d && \
echo "$USER ALL=(ALL) NOPASSWD: /usr/bin/docker" > /etc/sudoers.d/docker

# Set the working directory and set the default command
WORKDIR /workspace

# Revert back to a non-root user (assuming $USER is a non-root user in the Prefect image)
USER $USER

# Optionally, expose Docker socket if needed (to share Docker daemon)
VOLUME ["/var/run/docker.sock:/var/run/docker.sock"]

# Install Docker CLI
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list && \
apt-get update && apt-get install -y --no-install-recommends \
docker-ce-cli && \
apt-get clean && rm -rf /var/lib/apt/lists/*

0 comments on commit 3c95150

Please sign in to comment.