Skip to content

Commit

Permalink
feat: garden-cli container build (experimental)
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Sep 28, 2018
1 parent d0e4035 commit 7d2b5e7
Show file tree
Hide file tree
Showing 8 changed files with 731 additions and 393 deletions.
10 changes: 10 additions & 0 deletions garden-cli/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.garden
dist/
src/
support/
test/
node_modules/
gulpfile.test
.dockerignore
.gitignore
tsconfig.*
39 changes: 39 additions & 0 deletions garden-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM node:10.11.0-alpine

WORKDIR /project
ENTRYPOINT [ "garden" ]

# system dependencies
RUN apk add --no-cache \
bash \
curl \
docker \
git \
openssl \
rsync \
&& curl -L https://storage.googleapis.com/kubernetes-helm/helm-v2.11.0-linux-amd64.tar.gz | tar xvz --strip-components=1 -C /usr/local/bin linux-amd64/helm \
&& chmod +x /usr/local/bin/helm \
&& helm init --client-only \
&& curl -L -o /usr/local/bin/stern "https://github.com/wercker/stern/releases/download/1.8.0/stern_linux_amd64" \
&& chmod +x /usr/local/bin/stern \
&& curl -L -o /usr/local/bin/faas-cli "https://github.com/openfaas/faas-cli/releases/download/0.7.3/faas-cli" \
&& chmod +x /usr/local/bin/faas-cli \
&& curl -L -o /usr/local/bin/kubectl "https://storage.googleapis.com/kubernetes-release/release/v1.11.3/bin/linux/amd64/kubectl" \
&& chmod +x /usr/local/bin/kubectl

# npm dependencies
ADD package.json package-lock.json /garden/

RUN apk add --no-cache --virtual .deps \
python2 \
make \
g++ \
&& cd /garden && npm install --production \
&& apk del .deps

# garden code
ADD build /garden/build
ADD static /garden/static

RUN ln -s /garden/static/bin/garden /bin/garden \
&& chmod +x /bin/garden
16 changes: 16 additions & 0 deletions garden-cli/bin/garden
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e
set -o pipefail

docker run -it \
--net=host \
-v "$(cd $(git rev-parse --show-toplevel) && pwd):/project:delegated" \
-v "/var/run/docker.sock:/var/run/docker.sock" \
-v "$(cd ~ && pwd)/.docker:/root/.docker" \
-v "$(cd ~ && pwd)/.kube:/root/.kube" \
--workdir "/project/$(git rev-parse --show-prefix)" \
garden-cli "$@"

#-v "$(cd ~ && pwd)/.helm:/root/.helm" \
#--entrypoint=/bin/sh \
Loading

0 comments on commit 7d2b5e7

Please sign in to comment.