Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Docker hanging on large user IDs #8

Merged
merged 2 commits into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# 0.2.1 (in progress)
# 0.2.2

- Added fix for an issue where large user IDs would crash Docker during the
build phase. https://github.com/google/caliban/pull/8

# 0.2.1

- Added support for Conda dependencies
(https://github.com/google/caliban/pull/5). If you include `environment.yml`
Expand Down
5 changes: 3 additions & 2 deletions caliban/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,9 @@ def _dockerfile_template(
# Create the same group we're using on the host machine.
RUN [ $(getent group {gid}) ] || groupadd --gid {gid} {gid}

# Create the user by name.
RUN useradd --no-create-home -u {uid} -g {gid} --shell /bin/bash {username}
# Create the user by name. --no-log-init guards against a crash with large user
# IDs.
RUN useradd --no-log-init --no-create-home -u {uid} -g {gid} --shell /bin/bash {username}

# The directory is created by root. This sets permissions so that any user can
# access the folder.
Expand Down