Skip to content

Clean up dockerfiles to enable non-root usage - #2583

Merged
GMNGeoffrey merged 6 commits into
iree-org:mainfrom
GMNGeoffrey:dockerfile-cleanup
Jul 21, 2020
Merged

GMNGeoffrey merged 6 commits into
iree-org:mainfrom
GMNGeoffrey:dockerfile-cleanup

Conversation

@GMNGeoffrey

@GMNGeoffrey GMNGeoffrey commented Jul 20, 2020 •

Copy link
Copy Markdown
Member

Enables running our Docker builds as an arbitrary non-root user.

This allows usage of docker run without weird things like all the
files created being owned by root. It also includes updates to make
it possible to run the docker scripts locally provided the relevant
env variables are set.

This includes simplification of the Bazel installation to just use
apt. I tried to get rid of the necessity for the scary-looking
APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE, but I couldn't find any
alternatives. The warning message it prints doesn't even make
sense as a warning.

Reworks the update script to allow updating multiple images at
once including updating all images.

Also institutes some general Docker best practices like
apt-get cache busting
and
layer minimization
(although note on the latter that it looks like we might want to
investigate multi-stage builds).

Part of #2565

Tested:
Set build scripts to use the "latest" tag and ran all the presubmits,
including manually triggering the linux_x86-turing_cmake, which is
not enabled by default yet. See status for
d44f343 (#2583)

#2566 makes our Docker scripts
actually run without root and use these images (including manually
triggering builds that aren't running by default yet):

Comment thread build_tools/docker/bazel/Dockerfile Resolved
Comment thread build_tools/docker/bazel/Dockerfile Resolved
Comment thread build_tools/docker/cmake/Dockerfile Resolved
@GMNGeoffrey

Copy link
Copy Markdown
Member Author

@antiagainst any more comments?

@GMNGeoffrey
GMNGeoffrey merged commit 7dd3882 into iree-org:main Jul 21, 2020
@GMNGeoffrey
GMNGeoffrey deleted the dockerfile-cleanup branch July 21, 2020 23:02
GMNGeoffrey added a commit that referenced this pull request Jul 22, 2020
@GMNGeoffrey GMNGeoffrey added the infrastructure Relating to build systems, CI, or testing label Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Relating to build systems, CI, or testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants