You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by jo...@apache.org on 2020/04/12 01:24:25 UTC

[incubator-heron] branch joshfischer/update-site-build updated: adjust user settings

This is an automated email from the ASF dual-hosted git repository.

joshfischer pushed a commit to branch joshfischer/update-site-build
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


The following commit(s) were added to refs/heads/joshfischer/update-site-build by this push:
     new 04f8824  adjust user settings
04f8824 is described below

commit 04f8824d5fb89618f93ef74debbd02c67feb1f0a
Author: Josh Fischer <jo...@joshfischer.io>
AuthorDate: Sat Apr 11 20:24:02 2020 -0500

    adjust user settings
---
 website2/website/scripts/Dockerfile.ubuntu18.04 | 10 ++++++++--
 website2/website/scripts/compile-docker.sh      |  3 +++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/website2/website/scripts/Dockerfile.ubuntu18.04 b/website2/website/scripts/Dockerfile.ubuntu18.04
index 6e7f0b6..9d16f48 100644
--- a/website2/website/scripts/Dockerfile.ubuntu18.04
+++ b/website2/website/scripts/Dockerfile.ubuntu18.04
@@ -52,11 +52,17 @@ RUN apt-get update && apt-get install -y nodejs
 
 ENV JAVA_HOME /usr/lib/jvm/java-11-openjdk-amd64
 
+ARG UNAME
+ARG UID
+ARG GID
+RUN groupadd -g $GID -o $UNAME
+RUN useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME
+USER $UNAME
 
 RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
       && chmod +x /tmp/bazel.sh \
       && /tmp/bazel.sh --user
 
-ADD bazelrc /home/$USER/.bazelrc
-ENV PATH="/home/$USER/bin:${PATH}"
+ADD bazelrc /home/$UNAME/.bazelrc
+ENV PATH="/home/$UNAME/bin:${PATH}"
 
diff --git a/website2/website/scripts/compile-docker.sh b/website2/website/scripts/compile-docker.sh
index 1e96fb3..0c21211 100755
--- a/website2/website/scripts/compile-docker.sh
+++ b/website2/website/scripts/compile-docker.sh
@@ -54,6 +54,9 @@ echo $DOCKER_FILE
 
 echo "Building heron-compiler container"
 docker build \
+  --build-arg UNAME=$USER \
+  --build-arg UID=$(id -u ${USER}) \
+  --build-arg GID=$(id -g ${USER}) \
   -t heron-compiler:$TARGET_PLATFORM -f $DOCKER_FILE .