-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from stakpak/stakpak-Dockerfile
Add Docker in Docker Capability for Stakpak CLI
- Loading branch information
Showing
1 changed file
with
19 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 \ | ||
|
@@ -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) && \ | ||
|
@@ -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"] |