Open
Conversation
Hardcoding user and group ARGS into the shell commands fixed an issue I was having:
When passing ${user_name}:${group_name}, etc etc, the shell was reading all the args as "0" instead of 1000 etc. This caused the make to fail.
Step 8/27 : ARG group_id=1000
---> Using cache
---> 4e5b9a63b30e
Step 9/27 : RUN groupadd -g ${group_id} ${group_name}
---> Running in 30201b6ab1bb
groupadd: GID '0' already exists
The command '/bin/sh -c groupadd -g ${group_id} ${group_name}' returned a non-zero code: 4
Makefile:11: recipe for target 'docker-build' failed
make: *** [docker-build] Error 4
Step 8/27 : ARG group_id=1000
---> Using cache
---> 4e5b9a63b30e
Step 9/27 : RUN groupadd -g 1000 ubuntu
---> Running in 35d12c8401c4
Removing intermediate container 35d12c8401c4
---> 57185d9d33e8
Step 10/27 : RUN useradd -u ${user_id} -g ${group_id} -d /home/${user_name} --create-home --shell /bin/bash ${user_name}
---> Running in 7d09306b8138
useradd: UID 0 is not unique
The command '/bin/sh -c useradd -u ${user_id} -g ${group_id} -d /home/${user_name} --create-home --shell /bin/bash ${user_name}' returned a non-zero code: 4
Makefile:11: recipe for target 'docker-build' failed
make: *** [docker-build] Error 4
Hardcode user/group ARGS
Seems to fix issue stalling at
RUN chown -R ${user_name}:${group_name} $HOME/anaconda3
I strongly suspect the stalling/locking up is unrelated to these changes, however.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was to fix lockup issue with RUN chown -R ${user_name}:${group_name} $HOME/anaconda3
That long pause is apparently normal, seems to clear up after ~30 minutes.
However, this is still a better build file due to its use of ${user_name}:${group_name} rather than hardcoded strings, so will complete pull request.