diff --git a/contrib/build-linux/appimage/Dockerfile b/contrib/build-linux/appimage/Dockerfile index 5f43ac930..a20cebb9b 100644 --- a/contrib/build-linux/appimage/Dockerfile +++ b/contrib/build-linux/appimage/Dockerfile @@ -74,13 +74,13 @@ RUN apt-get update -q && \ apt-get clean # create new user to avoid using root; but with sudo access and no password for convenience. -ARG UID=1000 -RUN if [ "$UID" != "0" ] ; then useradd --uid $UID --create-home --shell /bin/bash "user" ; fi -RUN usermod -append --groups sudo $(id -nu $UID || echo "user") +# NOTE: UID *MUST* align with buildozer's Dockerfile "user" +RUN useradd -u 1000 -m -s /usr/bin/bash -d /home/user user +RUN usermod -aG sudo user RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -RUN HOME_DIR=$(getent passwd $UID | cut -d: -f6) -ENV WORK_DIR="${HOME_DIR}/wspace" \ - PATH="${HOME_DIR}/.local/bin:${PATH}" +ENV HOME_DIR=/home/user +ENV WORK_DIR="${HOME_DIR}/wspace" +ENV PATH="${HOME_DIR}/.local/bin:${PATH}" WORKDIR ${WORK_DIR} -RUN chown --recursive ${UID} ${WORK_DIR} -USER ${UID} +RUN chown -R user ${WORK_DIR} +USER user diff --git a/contrib/build-linux/sdist/Dockerfile b/contrib/build-linux/sdist/Dockerfile index 3b6f12112..4320eb577 100644 --- a/contrib/build-linux/sdist/Dockerfile +++ b/contrib/build-linux/sdist/Dockerfile @@ -17,13 +17,13 @@ RUN apt-get update -q && \ apt-get clean # create new user to avoid using root; but with sudo access and no password for convenience. -ARG UID=1000 -RUN if [ "$UID" != "0" ] ; then useradd --uid $UID --create-home --shell /bin/bash "user" ; fi -RUN usermod -append --groups sudo $(id -nu $UID || echo "user") +# NOTE: UID *MUST* align with buildozer's Dockerfile "user" +RUN useradd -u 1000 -m -s /usr/bin/bash -d /home/user user +RUN usermod -aG sudo user RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -RUN HOME_DIR=$(getent passwd $UID | cut -d: -f6) -ENV WORK_DIR="${HOME_DIR}/wspace" \ - PATH="${HOME_DIR}/.local/bin:${PATH}" +ENV HOME_DIR=/home/user +ENV WORK_DIR="${HOME_DIR}/wspace" +ENV PATH="${HOME_DIR}/.local/bin:${PATH}" WORKDIR ${WORK_DIR} -RUN chown --recursive ${UID} ${WORK_DIR} -USER ${UID} +RUN chown -R user ${WORK_DIR} +USER user diff --git a/contrib/build-wine/Dockerfile b/contrib/build-wine/Dockerfile index 4a7022bce..62d2ccd6c 100644 --- a/contrib/build-wine/Dockerfile +++ b/contrib/build-wine/Dockerfile @@ -57,16 +57,15 @@ RUN DEBIAN_CODENAME=$(lsb_release --codename --short) && \ apt-get clean # create new user to avoid using root; but with sudo access and no password for convenience. -ARG UID=1000 -RUN if [ "$UID" != "0" ] ; then useradd --uid $UID --create-home --shell /bin/bash "user" ; fi -RUN usermod -append --groups sudo $(id -nu $UID || echo "user") +# NOTE: UID *MUST* align with buildozer's Dockerfile "user" +RUN useradd -u 1000 -m -s /usr/bin/bash -d /home/user user +RUN usermod -aG sudo user RUN echo "%sudo ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers -RUN HOME_DIR=$(getent passwd $UID | cut -d: -f6) -ENV WORK_DIR="${HOME_DIR}/wspace" \ - PATH="${HOME_DIR}/.local/bin:${PATH}" +ENV HOME_DIR=/home/user +ENV WORK_DIR="${HOME_DIR}/wspace" +ENV PATH="${HOME_DIR}/.local/bin:${PATH}" WORKDIR ${WORK_DIR} -RUN chown --recursive ${UID} ${WORK_DIR} -RUN chown ${UID} /opt -USER ${UID} +RUN chown -R user ${WORK_DIR} /opt +USER user RUN mkdir --parents "/opt/wine64/drive_c/electrum"