mirror of
https://github.com/verilator/verilator.git
synced 2024-12-29 10:47:34 +00:00
Devcontainer support (#4748)
devcontainers are a convenient way to provide users a reproducible build environment. It is currently supported by Visual Studio Code, Visual Studio and IntelliJ. When the user opens the verilator repo in VSCode with the standard devcontainer extension installed, VSCode will ask the user if they want to reopen in the devcontainer, then build the Docker image as per our definition and then restart VSCode 'remotely' attached to the Docker container. More information: https://code.visualstudio.com/docs/devcontainers/containers Also: - zlibc is missing on Debian-based systems now - Add non-root user to Dockerfile and make default
This commit is contained in:
parent
b60117c713
commit
b65f2509a2
8
.devcontainer/devcontainer.json
Normal file
8
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "Verilator Build Environment",
|
||||
|
||||
"build": {
|
||||
"dockerfile": "../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" ]
|
||||
|
Loading…
Reference in New Issue
Block a user