-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
53 lines (41 loc) · 1.98 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM rigetti/quilc:1.20.0 as quilc
FROM rigetti/qvm:1.17.1 as qvm
FROM python:3.9
# use an entrypoint script to add startup commands (qvm & quilc server spinup)
WORKDIR /code
# Installing QVM and quilc (https://github.com/rigetti/pyquil/blob/master/Dockerfile)
# copy over the pre-built quilc binary from the first build stage
COPY --from=quilc /src/quilc/quilc /usr/local/bin/quilc
# copy over the pre-built qvm binary from the second build stage
COPY --from=qvm /src/qvm/qvm /usr/local/bin/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/*
COPY requirements.txt .
RUN pip install -r requirements.txt
# Installing Q# Dependency
RUN apt install libgomp1
# Installing .NET (https://github.com/microsoft/iqsharp/blob/main/images/iqsharp-base/Dockerfile)
RUN wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg && \
mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/ && \
wget -q https://packages.microsoft.com/config/debian/9/prod.list && \
mv prod.list /etc/apt/sources.list.d/microsoft-prod.list && \
chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg && \
chown root:root /etc/apt/sources.list.d/microsoft-prod.list && \
apt-get -y update && \
apt-get -y install dotnet-sdk-3.1=3.1.416-1 dotnet-sdk-6.0 && \
apt-get -y install procps && \
apt-get clean && rm -rf /var/lib/apt/lists/
#ENV PATH=$PATH:${HOME}/dotnet:${HOME}/.dotnet/tools \
# DOTNET_ROOT=${HOME}/dotnet
RUN dotnet new -i "Microsoft.Quantum.ProjectTemplates::0.26.233415"
RUN dotnet tool install \
--global \
Microsoft.Quantum.IQSharp
RUN ~/.dotnet/tools/dotnet-iqsharp install --user --path-to-tool="~/.dotnet/tools/dotnet-iqsharp"
RUN export PATH="$PATH:/root/.dotnet/tools"
COPY . .
EXPOSE 5012
CMD [ "python", "-m","api.api_service" ]