Last active
April 24, 2019 14:56
-
-
Save thefringeninja/c3d3a89142b1d5820c0bb9b1a442496d to your computer and use it in GitHub Desktop.
Dockerized Pulumi
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
FROM pulumi/pulumi as build | |
RUN curl -L https://storage.googleapis.com/kubernetes-helm/helm-v2.13.1-linux-amd64.tar.gz | tar xvz \ | |
&& mv linux-amd64/helm /usr/bin/helm \ | |
&& chmod +x /usr/bin/helm \ | |
&& rm -rf linux-amd64 | |
ARG UID=1000 | |
ARG GID=1000 | |
RUN groupadd -g $GID -o user \ | |
&& useradd -m -u $UID -g $GID -o -s /bin/bash user | |
USER user | |
RUN helm init --client-only | |
RUN mkdir -p /home/user/app | |
WORKDIR /home/user/app | |
COPY --chown=user:user package.json yarn.lock ./ | |
RUN yarn --frozen-lockfile | |
COPY --chown=user:user . . |
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
#!/usr/bin/env bash | |
set -e | |
docker build \ | |
--build-arg UID=$(id -u) \ | |
--build-arg GID=$(id -g) \ | |
--tag pulumi-runner \ | |
. | |
mkdir -p ~/.aws | |
mkdir -p ~/.pulumi | |
docker run --rm -it \ | |
--volume ~/.aws:/home/user/.aws \ | |
--volume ~/.pulumi:/home/user/.pulumi \ | |
--volume ${KUBECONFIG}:/home/user/.kube/config \ | |
--user $(id -u):$(id -g) \ | |
--env "KUBECONFIG=/home/user/.kube/config" \ | |
--network=host \ | |
pulumi-runner \ | |
"$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment