diff --git a/lazyDir/centos6.Dockerfile b/lazyDir/centos6.Dockerfile index da14491..812089c 100644 --- a/lazyDir/centos6.Dockerfile +++ b/lazyDir/centos6.Dockerfile @@ -83,7 +83,10 @@ ARG gid=1000 ARG group=dummy -RUN groupadd -g "${gid}" "${group}" && useradd -ms /bin/bash -g "${group}" -u "${uid}" "${user}" +# Add or modify user and group for build and runtime (convenient) +RUN id ${user} > /dev/null 2>&1 && \ + { groupmod -g "${gid}" "${group}" && usermod -md /home/${user} -s /bin/bash -g "${group}" -u "${uid}" "${user}"; } || \ + { groupadd -g "${gid}" "${group}" && useradd -md /home/${user} -s /bin/bash -g "${group}" -u "${uid}" "${user}"; } # Get script directory from lazyLib ARG dir=. diff --git a/lazyDir/centos7.Dockerfile b/lazyDir/centos7.Dockerfile index d27a61b..343f350 100644 --- a/lazyDir/centos7.Dockerfile +++ b/lazyDir/centos7.Dockerfile @@ -83,7 +83,10 @@ ARG gid=1000 ARG group=dummy -RUN groupadd -g "${gid}" "${group}" && useradd -ms /bin/bash -g "${group}" -u "${uid}" "${user}" +# Add or modify user and group for build and runtime (convenient) +RUN id ${user} > /dev/null 2>&1 && \ + { groupmod -g "${gid}" "${group}" && usermod -md /home/${user} -s /bin/bash -g "${group}" -u "${uid}" "${user}"; } || \ + { groupadd -g "${gid}" "${group}" && useradd -md /home/${user} -s /bin/bash -g "${group}" -u "${uid}" "${user}"; } # Get script directory from lazyLib ARG dir=. diff --git a/lazyDir/ubuntu16.Dockerfile b/lazyDir/ubuntu16.Dockerfile index bdb260a..c1426e2 100644 --- a/lazyDir/ubuntu16.Dockerfile +++ b/lazyDir/ubuntu16.Dockerfile @@ -1,18 +1,37 @@ +# +# This work is protected under copyright law in the Kingdom of +# The Netherlands. The rules of the Berne Convention for the +# Protection of Literary and Artistic Works apply. +# Digital Me B.V. is the copyright owner. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + # Pull base image from official repo FROM ubuntu:16.04 # Install all current updates -RUN apt-get -y update \ - && apt-get -y dist-upgrade \ - && apt-get clean +RUN apt-get -y update && \ + apt-get -y dist-upgrade && \ + apt-get clean # Install common requirements -RUN apt-get -y update \ - && apt-get -y install \ - git \ - wget \ - unzip \ - && apt-get clean +RUN apt-get -y update && \ + apt-get -y install \ + git \ + unzip \ + wget \ + apt-get clean # Add user to build and package ARG uid=1000 @@ -20,7 +39,10 @@ ARG gid=1000 ARG group=dummy -RUN groupadd -g "${gid}" "${group}" && useradd -ms /bin/bash -g "${group}" -u "${uid}" "${user}" +# Add or modify user and group for build and runtime (convenient) +RUN id ${user} > /dev/null 2>&1 && \ + { groupmod -g "${gid}" "${group}" && usermod -md /home/${user} -s /bin/bash -g "${group}" -u "${uid}" "${user}"; } || \ + { groupadd -g "${gid}" "${group}" && useradd -md /home/${user} -s /bin/bash -g "${group}" -u "${uid}" "${user}"; } # Get script directory from lazyLib ARG dir=.