Skip to content

Commit

Permalink
Merge pull request #17 from stakpak/stakpak-Dockerfile
Browse files Browse the repository at this point in the history
Add Docker in Docker Capability for Stakpak CLI
  • Loading branch information
kajogo777 authored Jan 7, 2025
2 parents b958ef3 + 63643e0 commit 0d5ecdb
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ LABEL org.opencontainers.image.source="https://github.com/stakpak/cli" \
org.opencontainers.image.description="Stakpak CLI Tool" \
maintainer="[email protected]"

RUN apt-get update -y && apt-get install -y curl \
# Install basic dependencies
RUN apt-get update -y && apt-get install -y \
curl \
unzip \
git \
apt-transport-https \
Expand All @@ -22,6 +24,18 @@ RUN apt-get update -y && apt-get install -y curl \
dnsutils \
&& rm -rf /var/lib/apt/lists/*

# Install Docker CLI
RUN install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \
&& chmod a+r /etc/apt/keyrings/docker.gpg \
&& echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null \
&& apt-get update \
&& apt-get install -y docker-ce-cli \
&& rm -rf /var/lib/apt/lists/*

# Install aws cli
RUN cd /tmp && \
ARCH=$(uname -m) && \
Expand Down Expand Up @@ -56,10 +70,11 @@ RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.
# Install azure cli
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash

WORKDIR /usr/local/bin
COPY --from=builder /usr/src/app/target/release/stakpak .
COPY --from=builder /usr/src/app/target/release/stakpak /usr/local/bin
RUN chmod +x /usr/local/bin/stakpak

#USER nobody
# Create docker group
RUN groupadd -r docker

ENTRYPOINT ["/usr/local/bin/stakpak"]
CMD ["--help"]

0 comments on commit 0d5ecdb

Please sign in to comment.