-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
42 lines (34 loc) · 1.2 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
# build from the forest Docker image
FROM rigetti/forest:3.0.0
# install requirements for latex generation
RUN apt-get update && apt-get -yq dist-upgrade && \
apt-get install --no-install-recommends -yq \
ghostscript imagemagick texlive-latex-base texlive-latex-extra && \
rm -rf /var/lib/apt/lists/*
# install requirements for running pyQuil tutorial notebooks
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
# install jupyter notebook and jupyter lab
RUN pip install --no-cache-dir notebook jupyterlab
# create user with UID 1000 and associated home dir (required by binder)
ARG NB_USER=binder
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}
# copy over files from the repository into /home/forest-notebook
COPY . /src/forest-notebook
# transfer ownership of /home/binder and /src to binder user
USER root
RUN chown -R ${NB_UID} ${HOME}
RUN chown -R ${NB_UID} /src
USER ${NB_USER}
# signal that we need to publish port 8888 to run the notebook server
EXPOSE 8888
# run the notebook server
WORKDIR /src/pyquil
CMD ["jupyter", "lab", "--ip=0.0.0.0"]