forked from rigetti/pyquil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (26 loc) · 1.1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# use multi-stage builds to independently pull dependency versions
ARG quilc_version=1.20.0
ARG qvm_version=1.17.1
ARG python_version=3.8
# use multi-stage builds to independently pull dependency versions
FROM rigetti/quilc:$quilc_version as quilc
FROM rigetti/qvm:$qvm_version as qvm
FROM python:$python_version-buster
ARG pyquil_version
# copy over the pre-built quilc binary from the first build stage
COPY --from=quilc /src/quilc/quilc /src/quilc/quilc
# copy over the pre-built qvm binary from the second build stage
COPY --from=qvm /src/qvm/qvm /src/qvm/qvm
# install the missing apt packages that aren't copied over
RUN apt-get update && apt-get -yq dist-upgrade && \
apt-get install --no-install-recommends -yq \
git libblas-dev libffi-dev liblapack-dev libzmq3-dev && \
rm -rf /var/lib/apt/lists/*
# install ipython
RUN pip install --no-cache-dir ipython
# install pyquil
RUN pip install pyquil==$pyquil_version
# use an entrypoint script to add startup commands (qvm & quilc server spinup)
COPY ./entrypoint.sh /src/pyquil/entrypoint.sh
ENTRYPOINT ["/src/pyquil/entrypoint.sh"]
CMD ["ipython"]