Skip to content

Commit

Permalink
Allow passwordless sudo in docker images
Browse files Browse the repository at this point in the history
This will allow to run commands like apt with other users besides root.
Allowing us to install stuff not only when the image is being created.

Signed-off-by: Boian Petkantchin <boian.petkantchin@amd.com>
  • Loading branch information
sogartar committed May 23, 2024
1 parent a3b74bc commit d553a8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
3 changes: 2 additions & 1 deletion build_tools/docker/context/install_basics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ set -euo pipefail
# (https://docs.docker.com/develop/develop-images/multistage-build/) but it
# turns out that Dockerfile is a thoroughly non-composable awful format and that
# doesn't actually work that well. These deps are pretty small.
apt-get update && apt-get install -y git unzip wget curl gnupg2 lsb-release
apt-get update && apt-get install -y git unzip wget curl gnupg2 lsb-release sudo
echo "ALL ALL=NOPASSWD: ALL" > "/etc/sudoers.d/iree"
15 changes: 2 additions & 13 deletions build_tools/docker/dockerfiles/base-bleeding-edge.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,8 @@ ARG APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1

######## Basic stuff ########
WORKDIR /install-basics
# Useful utilities for building child images. Best practices would tell us to
# use multi-stage builds
# (https://docs.docker.com/develop/develop-images/multistage-build/) but it
# turns out that Dockerfile is a thoroughly non-composable awful format and that
# doesn't actually work that well. These deps are pretty small.
RUN apt-get update \
&& apt-get install -y \
git \
unzip \
wget \
curl \
gnupg2 \
lsb-release
COPY build_tools/docker/context/install_basics.sh ./
RUN ./install_basics.sh && rm -rf /install-basics

# Install the latest supported compiler tools
ARG LLVM_VERSION=19
Expand Down

0 comments on commit d553a8a

Please sign in to comment.