Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from linaro-its/feature/docker-build_netlify-cms
Browse files Browse the repository at this point in the history
Feature/docker build netlify cms
  • Loading branch information
morancj authored Nov 20, 2019
2 parents 592acf2 + fd5d163 commit cf9acb4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions build_netlify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e
set -x

mkdir -p ".yarn" ".yarn_cache"
yarn --global-folder "$(pwd)/.yarn" --cache-folder "$(pwd)/.yarn_cache"
yarn bootstrap
yarn build
28 changes: 28 additions & 0 deletions docker_build_netlify-cms.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
# Exit on errors
set -e
set -x

# Variables
DOCKER_SOURCE_IMAGE="node"
DOCKER_IMAGE_VERSION="13.1.0-stretch-slim"
HOSTNAME="$(hostname)"
USER="$(id -u)"
GROUP="$(id -g)"
CURRENT_DIR="$(pwd)"
DOCKER_WORKDIR="${HOME}"

docker run\
--cap-drop=all\
--memory=4GB\
--rm\
-i\
-v "${CURRENT_DIR}":"${DOCKER_WORKDIR}"\
-v /etc/group:/etc/group:ro\
-v /etc/passwd:/etc/passwd:ro\
-u "${USER}":"${GROUP}"\
-w "${DOCKER_WORKDIR}"\
--hostname="${HOSTNAME}"-netlify-builder-13-1-0\
--name=netlify_builder\
"${DOCKER_SOURCE_IMAGE}":"${DOCKER_IMAGE_VERSION}"\
/bin/bash -c "${DOCKER_WORKDIR}/build_netlify.sh"

0 comments on commit cf9acb4

Please sign in to comment.