Dockerfile: move sudo to standard Dockerfile

To expand the usability of the standard Docker image, move sudo
enablement from Docker.isar.

Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jon Mason 2021-04-26 17:01:59 +02:00 committed by Jan Kiszka
parent 6e82e0d12d
commit eb63b1873b
2 changed files with 8 additions and 8 deletions

View File

@ -18,7 +18,7 @@ RUN apt-get install --no-install-recommends -y \
python3-setuptools python3-wheel python3-yaml python3-distro python3-jsonschema \
gosu lsb-release file vim less procps tree tar bzip2 zstd bc tmux libncurses-dev \
dosfstools mtools parted \
git-lfs mercurial iproute2 ssh-client curl rsync gnupg awscli && \
git-lfs mercurial iproute2 ssh-client curl rsync gnupg awscli sudo && \
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
apt-get install --no-install-recommends -y gcc-multilib syslinux; \
fi && \
@ -33,4 +33,10 @@ ENV GIT_PROXY_COMMAND="oe-git-proxy" \
COPY . /kas
RUN pip3 --proxy=$https_proxy install --no-deps /kas && kas --help
RUN echo "builder ALL=NOPASSWD: ALL" > /etc/sudoers.d/builder-nopasswd && \
chmod 660 /etc/sudoers.d/builder-nopasswd
RUN echo "Defaults env_keep += \"ftp_proxy http_proxy https_proxy no_proxy\"" \
> /etc/sudoers.d/env_keep && chmod 660 /etc/sudoers.d/env_keep
ENTRYPOINT ["/kas/container-entrypoint"]

View File

@ -14,16 +14,10 @@ RUN echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sou
apt-get update && \
apt-get install -y -f --no-install-recommends \
autoconf automake gdisk libtool bash-completion \
sudo reprepro python3 binfmt-support e2fsprogs \
reprepro python3 binfmt-support e2fsprogs \
umoci skopeo \
multistrap qemu-user-static debootstrap quilt && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN echo "builder ALL=NOPASSWD: ALL" > /etc/sudoers.d/builder-nopasswd && \
chmod 660 /etc/sudoers.d/builder-nopasswd
RUN echo "Defaults env_keep += \"ftp_proxy http_proxy https_proxy no_proxy\"" \
> /etc/sudoers.d/env_keep && chmod 660 /etc/sudoers.d/env_keep
RUN sed -i 's|#!/bin/bash|\0\n\nupdate-binfmts --enable \&\& [ -f /proc/sys/fs/binfmt_misc/status ]|' /kas/container-entrypoint