Skip to content

Commit 5bc9229

Browse files
committed
sudoers.d drop-in config fixed; MODULE.bazel.lock needs be removed, to change dependency versions.
1 parent 96947da commit 5bc9229

File tree

4 files changed

+29
-36
lines changed

4 files changed

+29
-36
lines changed

docker/rhel-integration/Dockerfile

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ ARG RUNNER_UID="1001"
1515
ENV GID="${RUNNER_GID}"
1616
ENV UID="${RUNNER_UID}"
1717

18-
# Adding the user provides the home directory.
19-
RUN groupadd -f -g ${GID} docker
20-
RUN useradd -g ${GID} -u ${UID} -s /bin/bash runner
21-
22-
# Don't ask for the `sudo` password.
23-
RUN [ "echo", "%docker", "ALL=(ALL)", "NOPASSWD:", "ALL", ">", "/etc/sudoers.d/docker.conf" ]
24-
2518
# The EPEL repository installs `dnf-core-plugin` (`config-manager` and `builddeps`) and provides `ncurses-compat-libs`.
2619
# Configuring further package repositories: / https://wiki.rockylinux.org/rocky/repo/#extra-repositories
2720
RUN [ "dnf", "-y", "install", "sudo", "nano", "wget", "https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm"]
@@ -30,10 +23,15 @@ RUN [ "dnf", "config-manager", "--set-enabled", "crb" ]
3023
RUN [ "dnf", "-y", "upgrade" ]
3124
RUN [ "dnf", "clean", "all" ]
3225

33-
# Import Google RPM repository public key.
34-
# https://www.google.com/linuxrepositories/
35-
# RUN [ "wget", "https://dl.google.com/linux/linux_signing_key.pub" ]
36-
# RUN [ "rpm", "--import", "linux_signing_key.pub" ]
26+
# Adding group `docker`.
27+
RUN groupadd -f -g ${GID} docker
28+
29+
# Adding group `docker` as sudoers drop-in config file ...
30+
# `sudo` must be installed and the filename must not contain a dot.
31+
RUN echo '%docker ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/docker
32+
33+
# Adding user `runner` provides the home directory.
34+
RUN useradd -g ${GID} -u ${UID} -s /bin/bash runner
3735

3836

3937
# Integration

docker/rhel-orchestration/Dockerfile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@ ARG RUNNER_UID="1001"
1515
ENV GID="${RUNNER_GID}"
1616
ENV UID="${RUNNER_UID}"
1717

18-
# Adding the user provides the home directory.
19-
RUN groupadd -f -g ${GID} docker
20-
RUN useradd -g ${GID} -u ${UID} -s /bin/bash runner
21-
22-
# Don't ask for the `sudo` password.
23-
RUN [ "echo", "%docker", "ALL=(ALL)", "NOPASSWD:", "ALL", ">", "/etc/sudoers.d/docker.conf" ]
24-
2518
# The EPEL repository installs `dnf-core-plugin` (`config-manager` and `builddeps`) and provides `ncurses-compat-libs`.
2619
# Configuring further package repositories: / https://wiki.rockylinux.org/rocky/repo/#extra-repositories
2720
RUN [ "dnf", "-y", "install", "sudo", "nano", "wget", "https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm"]
@@ -30,17 +23,20 @@ RUN [ "dnf", "config-manager", "--set-enabled", "crb" ]
3023
RUN [ "dnf", "-y", "upgrade" ]
3124
RUN [ "dnf", "clean", "all" ]
3225

33-
# Import Google RPM repository public key.
34-
# https://www.google.com/linuxrepositories/
35-
# RUN [ "wget", "https://dl.google.com/linux/linux_signing_key.pub" ]
36-
# RUN [ "rpm", "--import", "linux_signing_key.pub" ]
26+
# Adding group `docker`.
27+
RUN groupadd -f -g ${GID} docker
28+
29+
# Adding group `docker` as sudoers drop-in config file ...
30+
# `sudo` must be installed and the filename must not contain a dot.
31+
RUN echo '%docker ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/docker
3732

33+
# Adding user `runner` provides the home directory.
34+
RUN useradd -g ${GID} -u ${UID} -s /bin/bash runner
3835

3936
# Host Orchestration
4037
FROM base_image AS orchestration
4138
ARG ARTIFACT_PATH=./.rpms
4239

43-
4440
# Expose Operator Port (HTTP:1080, HTTPS:1443)
4541
EXPOSE 1080 1443
4642

docker/rpm-builder/Dockerfile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ ARG RUNNER_UID="1001"
1818
ENV GID="${RUNNER_GID}"
1919
ENV UID="${RUNNER_UID}"
2020

21-
# Adding the user provides the home directory.
22-
RUN groupadd -f -g ${GID} docker
23-
RUN useradd -g ${GID} -u ${UID} -s /bin/bash runner
24-
25-
# Don't ask for the `sudo` password.
26-
RUN [ "echo", "%docker", "ALL=(ALL)", "NOPASSWD:", "ALL", ">", "/etc/sudoers.d/docker.conf" ]
27-
2821
# The EPEL repository installs `dnf-core-plugin` (`config-manager` and `builddeps`) and provides `ncurses-compat-libs`.
2922
# Configuring further package repositories: / https://wiki.rockylinux.org/rocky/repo/#extra-repositories
3023
RUN [ "dnf", "-y", "install", "sudo", "nano", "wget", "https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm"]
@@ -33,10 +26,15 @@ RUN [ "dnf", "config-manager", "--set-enabled", "crb" ]
3326
RUN [ "dnf", "-y", "upgrade" ]
3427
RUN [ "dnf", "clean", "all" ]
3528

36-
# Import Google RPM repository public key.
37-
# https://www.google.com/linuxrepositories/
38-
# RUN [ "wget", "https://dl.google.com/linux/linux_signing_key.pub" ]
39-
# RUN [ "rpm", "--import", "linux_signing_key.pub" ]
29+
# Adding group `docker`.
30+
RUN groupadd -f -g ${GID} docker
31+
32+
# Adding group `docker` as sudoers drop-in config file ...
33+
# `sudo` must be installed and the filename must not contain a dot.
34+
RUN echo '%docker ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/docker
35+
36+
# Adding user `runner` provides the home directory.
37+
RUN useradd -g ${GID} -u ${UID} -s /bin/bash runner
4038

4139
# https://docs.docker.com/reference/dockerfile/#notes-about-specifying-volumes
4240
# The host directory is declared at container run-time, with `--volume`, eg.
@@ -79,7 +77,6 @@ COPY [ "./docker/rpm-builder/scripts/install_rpm.sh", "/home/runner/install_rpm.
7977
COPY [ "./docker/rpm-builder/scripts/patch_zlib.sh", "/home/runner/patch_zlib.sh" ]
8078
COPY [ "./docker/rpm-builder/build_rpm_spec.sh", "/home/runner/build_rpm_spec.sh" ]
8179

82-
8380
RUN [ "echo", "export", "GOPATH=/home/runner/go", ">>", "/home/runner/.bash_profile" ]
8481
RUN [ "echo", "export", "PATH=$PATH:/home/runner/go/bin", ">>", "/home/runner/.bash_profile" ]
8582
RUN [ "echo", "export", "BUILDX_GIT_LABELS=1", ">>", "/home/runner/.bash_profile" ]

docker/rpm-builder/scripts/patch_zlib.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ SEARCH='bazel_dep(name = "zlib", version = "1.3.1.bcr.3")'
99
REPLACE='bazel_dep(name = "zlib", version = "1.3.1.bcr.4")'
1010
cat "${CVD_DIR}/MODULE.bazel" | sed -e "s/${SEARCH}/${REPLACE}/" > "${CVD_DIR}/MODULE.patched"
1111
mv "${CVD_DIR}/MODULE.patched" "${CVD_DIR}/MODULE.bazel"
12-
echo "Patched: ${CVD_DIR}/MODULE.bazel: [email protected]"
12+
echo "RHEL patch: base/cvd/MODULE.bazel changed from [email protected] to [email protected]"
13+
rm "${CVD_DIR}/MODULE.bazel.lock"
14+
echo "RHEL patch: base/cvd/MODULE.bazel.lock also removed"

0 commit comments

Comments
 (0)