-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: garden-cli container build (experimental)
- Loading branch information
Showing
8 changed files
with
731 additions
and
393 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.garden | ||
dist/ | ||
src/ | ||
support/ | ||
test/ | ||
node_modules/ | ||
gulpfile.test | ||
.dockerignore | ||
.gitignore | ||
tsconfig.* |
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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
@@ -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 \ |
Oops, something went wrong.