Add docker_user and password args to Dockerfile
Symlinking /etc/passwd files leads to invalid cross-device link errors when running apt commands. Internally, apt uses dpkg, which adds a user "irc" when performing apt installs/upgrades. This subprocess leads to the error. The solution implemented here creates a user with the same name and id as the current user. This gives both users the the same file permissions, without having to symlink /etc/passwd.
This commit is contained in:
1 parent
fc316243c2
commit
f1d398ba81
2 files changed
+14
-1
No files matched your search
@@ -231,3 +231,9 @@ RUN \
|
||||
&& DEBIAN_FRONTEND=noninteractive apt-get autoremove -y
|
||||
|
||||
########################
|
||||
|
||||
ARG docker_user
|
||||
ARG docker_user_id
|
||||
ARG docker_password
|
||||
|
||||
RUN useradd -u $docker_user_id -m $docker_user && echo "${docker_user}:${docker_password}" | chpasswd && adduser $docker_user sudo
|
||||
Reference in new issue
Block a user