зеркало из https://github.com/mozilla/awebpodcast.git
Run gulp container as current user (#4)
Adapted from https://github.com/mozilla/irlpodcast/pull/197
This commit is contained in:
Родитель
311236d240
Коммит
b6468a5711
13
bin/build.sh
13
bin/build.sh
|
@ -4,12 +4,17 @@ set -ex
|
|||
cd "$(dirname ${BASH_SOURCE[0]})"/..
|
||||
mkdir -p ./release
|
||||
|
||||
# adapted from https://lebenplusplus.de/2018/03/15/how-to-run-npm-install-as-non-root-from-a-docker-container/
|
||||
echo "node:x:$(id -u):$(id -g)::/home/node:/bin/bash" > /tmp/fake-passwd
|
||||
|
||||
# let gulp build the assets
|
||||
docker run --rm --label=gulp \
|
||||
--volume=$(pwd):/srv \
|
||||
--entrypoint /bin/bash \
|
||||
huli/gulp \
|
||||
-c "/entrypoint.sh build --production && chown $(id -u):$(id -g) . -R"
|
||||
--volume=$(pwd):/srv \
|
||||
--volume=/tmp/fake-passwd:/etc/passwd \
|
||||
--volume=/tmp:/home/node \
|
||||
-u $(id -u):$(id -g) \
|
||||
huli/gulp \
|
||||
build --production
|
||||
|
||||
# and then let hugo build the site
|
||||
docker run --rm --label=hugo \
|
||||
|
|
Загрузка…
Ссылка в новой задаче