diff options
author | Serge Bazanski <q3k@q3k.org> | 2019-08-12 15:09:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-12 15:09:25 +0200 |
commit | 78b30bbb1102047585d1a2eac89b1c7f5ca7344e (patch) | |
tree | f23296adb386bd6e69674bb7dd37b54eeda04035 | |
parent | ba1a428f550d2bac91a442ccd04cb9e70833d093 (diff) | |
parent | 36c80cf4561cac321c0b0931b37ecac9dc42e07a (diff) | |
download | yosys-78b30bbb1102047585d1a2eac89b1c7f5ca7344e.tar.gz yosys-78b30bbb1102047585d1a2eac89b1c7f5ca7344e.tar.bz2 yosys-78b30bbb1102047585d1a2eac89b1c7f5ca7344e.zip |
Merge pull request #1152 from 1138-4EB/feat-docker
Dockerfile
-rw-r--r-- | Dockerfile | 74 |
1 files changed, 49 insertions, 25 deletions
diff --git a/Dockerfile b/Dockerfile index 3c7188d82..549c73c97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,57 @@ -FROM ubuntu:18.04 as builder -LABEL author="Abdelrahman Hosny <abdelrahman.hosny@hotmail.com>" -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y build-essential \ +ARG IMAGE="python:3-slim-buster" + +#--- + +FROM $IMAGE AS base + +RUN apt-get update -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ + ca-certificates \ clang \ + curl \ + libffi-dev \ + libreadline-dev \ + tcl-dev \ + graphviz \ + xdot \ + && apt-get autoclean && apt-get clean && apt-get -y autoremove \ + && update-ca-certificates \ + && rm -rf /var/lib/apt/lists + +#--- + +FROM base AS build + +RUN apt-get update -qq \ + && DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ bison \ flex \ - libreadline-dev \ gawk \ - tcl-dev \ - libffi-dev \ + gcc \ git \ + iverilog \ pkg-config \ - python3 && \ - rm -rf /var/lib/apt/lists -COPY . / -RUN make && \ - make install - -FROM ubuntu:18.04 -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update && apt-get install -y libreadline-dev tcl-dev - -COPY --from=builder /yosys /build/yosys -COPY --from=builder /yosys-abc /build/yosys-abc -COPY --from=builder /yosys-config /build/yosys-config -COPY --from=builder /yosys-filterlib /build/yosys-filterlib -COPY --from=builder /yosys-smtbmc /build/yosys-smtbmc - -ENV PATH /build:$PATH + && apt-get autoclean && apt-get clean && apt-get -y autoremove \ + && rm -rf /var/lib/apt/lists + +COPY . /yosys + +ENV PREFIX /opt/yosys + +RUN cd /yosys \ + && make \ + && make install \ + && make test + +#--- + +FROM base + +COPY --from=build /opt/yosys /opt/yosys + +ENV PATH /opt/yosys/bin:$PATH + RUN useradd -m yosys USER yosys -ENTRYPOINT ["yosys"] + +CMD ["yosys"] |