enola-dev / enola

Enola 🕵🏾‍♀️ Holmes was an SRE.
https://docs.enola.dev/
Apache License 2.0
19 stars 7 forks source link

devenv.bash fails on Fedora (and older Debian, but works on newest Debian/Ubtuntu) #515

Open vorburger opened 9 months ago

vorburger commented 9 months ago

I'm hitting this problem on a Fedora environment:

./devenv.bash
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
STEP 1/10: FROM docker.io/library/fedora:39
STEP 2/10: RUN dnf update -y
--> Using cache c0b7579c94d5e565ea4bfa5e72011703f8af7cc381bad335aa86b9b0899be74a
--> c0b7579c94d5
STEP 3/10: RUN dnf install -y fish gcc-c++ golang     java-21-openjdk-devel java-21-openjdk-src java-21-openjdk-javadoc     java-21-openjdk-javadoc-zip java-21-openjdk-jmods
--> Using cache 91e0b780616700b8e3b15fb1c086a7787a9514ed3b2ccc26b9f4094db8d5ad32
--> 91e0b7806167
STEP 4/10: RUN useradd "developer" &&     sed -i 's/# %wheel/%wheel/' /etc/sudoers &&     sudo usermod -aG wheel "developer"
--> Using cache c543e7672c216be64c89f9c8eca8ec2b12f79e1a405d6396eb13db30e878160d
--> c543e7672c21
STEP 5/10: USER developer
--> Using cache 57870902a803bfd56bec94105fba946f94703158f871ddd7600e37bcb9dfc76b
--> 57870902a803
STEP 6/10: RUN echo "export PATH=$PATH:/home/developer/go/bin" >> /home/developer/.bashrc
--> Using cache bc6993ae9ecfaa5f592c2f3df87b8fafa0b9d62c38e3beca5a10a437fdd1c821
--> bc6993ae9ecf
STEP 7/10: ADD tools/go/install.bash /tmp/go-install.bash
--> Using cache 3e4cb9215f574addd889f53f25b45eafa133628a753c5c4179d75dc099411c7b
--> 3e4cb9215f57
STEP 8/10: RUN /tmp/go-install.bash
--> Using cache 2ebf06a02894288c1c0b3685a6ea85ad3fcafbd6ba4bca7c394cd5fb04eacecd
--> 2ebf06a02894
STEP 9/10: WORKDIR /workspace/
--> Using cache 88f935f4fbfba19083429cf38a39e513377e12e08d97e1623eb91a69d19e34e1
--> 88f935f4fbfb
STEP 10/10: RUN --mount=type=bind,source=.,target=/workspace/ /workspace/tools/devenv/install.bash
/bin/sh: line 1: /workspace/tools/devenv/install.bash: Permission denied
Error: building at STEP "RUN --mount=type=bind,source=.,target=/workspace/ /workspace/tools/devenv/install.bash": while running runtime: exit status 126

I want to fix this, both as a pre-requisite for potentially working on #458, as well as to test out #512 myself.

@lbovet just FYI

vorburger commented 9 months ago

Error: building at STEP "RUN --mount=type=bind,source=.,target=/workspace/ /workspace/tools/devenv/install.bash": while running runtime: exit status 126

The reason for this is SELinux... that's why there is a :Z here.

I couldn't figure how to to use :Z in RUN --mount=type=bind,source=.,target=/workspace/ ....