53 lines
1.7 KiB
Docker

# syntax=docker/dockerfile:1
FROM ubuntu:22.10
LABEL description="Verilog playground"
# Prepare OS
RUN sed -i 's/^# *deb-src/deb-src/g' /etc/apt/sources.list
RUN apt-get -y update \
&& apt-get -y install guile-3.0 locales git
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen
RUN apt-get build-dep -y iverilog verilator
# Build latest Icarus Veriolog
WORKDIR /build
RUN git clone --depth 1 https://github.com/steveicarus/iverilog.git
WORKDIR /build/iverilog
RUN sh ./autoconf.sh && ./configure --prefix=/usr && make -j2 && make install
# Build latest Verilator
WORKDIR /build
RUN git clone --depth 1 https://github.com/verilator/verilator.git
WORKDIR /build/verilator
RUN autoconf && ./configure --prefix=/usr && make -j2 && make install
# Environment
ENV GIT_SSL_NO_VERIFY=1
ENV GUILE_LOAD_PATH=/server/embddr-scheme-library
ENV LANG=en_US.UTF-8
ENV DONOTUSEFIREJAIL=1
# Copy server files
WORKDIR /server
COPY server/* ./
RUN git clone https://git.embddr.com/np/embddr-scheme-library.git
RUN mkdir play-work /verilog-playground-store
EXPOSE 8080
VOLUME /verilog-playground-store
CMD [ "guile", "-e", "main", \
"./playground-server.scm", \
"--port=8080", \
"--addr=0.0.0.0", \
"--host=https://play.embddr.com", \
"--iverilog-wrap=./restrict", \
"--vvp-wrap=./restrict", \
"--verilator-sim-wrap=./restrict", \
"--verilator-build-jobs=2", \
"--max-len=10000", \
"--work-base=play-work", \
"--stor-base=/verilog-playground-store", \
"--log-level=2" ]