diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..c2235983d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "name": "Verilator Build Environment", + + "build": { + "dockerfile": "../ci/docker/buildenv/Dockerfile" + } + +} diff --git a/ci/docker/buildenv/Dockerfile b/ci/docker/buildenv/Dockerfile index 3e3fbe177..385e0b088 100644 --- a/ci/docker/buildenv/Dockerfile +++ b/ci/docker/buildenv/Dockerfile @@ -8,6 +8,16 @@ FROM ubuntu:22.04 +# Create the user +RUN groupadd verilator \ + && useradd -g verilator -m verilator -s /bin/bash \ + && apt-get update \ + && apt-get install --no-install-recommends -y sudo \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && echo verilator ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/verilator \ + && chmod 0440 /etc/sudoers.d/verilator + RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ apt-get install --no-install-recommends -y \ @@ -33,7 +43,6 @@ RUN apt-get update \ perl \ python3 \ wget \ - zlibc \ zlib1g \ zlib1g-dev \ && apt-get clean \ @@ -52,6 +61,8 @@ COPY build.sh /tmp/build.sh ENV VERILATOR_AUTHOR_SITE=1 +USER verilator + WORKDIR /work ENTRYPOINT [ "/tmp/build.sh" ]