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

Feature/docker build netlify cms #2

Merged
merged 4 commits into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"