Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the Docker image smaller and build faster #1039

Merged
merged 6 commits into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.coveragerc
.git
.gitlab-ci.yml
.gitignore
.github
docs
ACKNOWLEDGEMENTS.md
CHANGELOG.md
CONTRIBUTING.md
Makefile
MANIFEST.in
NOTICE.md
readthedocs.yml
tox.ini
12 changes: 12 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,15 @@ docs:
- apt-get update && apt-get install -y pandoc
- pandoc --from=markdown --to=rst --output=docs/source/changes.rst CHANGELOG.md
- tox -e docs

test-docker:
stage: test
image: docker:stable
tags:
- dockerd
- github
only:
refs:
- /^v(\d+\.)?(\d+\.)?(\d+)$/
script:
- docker run --rm $IMAGE:edge python -c "from pyquil import get_qc; qvm = get_qc('9q-qvm')"
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Changelog
to quickly get started with compiling and simulating quantum programs! When
running the image, a user will be dropped into an `ipython` REPL that has
pyQuil and its requirements preinstalled, along with quilc and qvm servers
running in the background (@karalekas, gh-1035).
running in the background (@karalekas, gh-1035, gh-1039).

### Improvements and Changes

Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# specify the dependency versions (can be overriden with --build-arg)
ARG quilc_version=1.12.0
ARG quilc_version=1.12.1
ARG qvm_version=1.12.0
ARG python_version=3.6

Expand All @@ -8,15 +8,15 @@ FROM rigetti/quilc:$quilc_version as quilc
FROM rigetti/qvm:$qvm_version as qvm
FROM python:$python_version

# copy over the pre-built quilc binary from the first build stage
COPY --from=quilc /src/quilc /src/quilc
# copy over the pre-built quilc binary and tweedledum library from the first build stage
COPY --from=quilc /usr/local/lib/libtweedledum.so /usr/local/lib/libtweedledum.so
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 /src/qvm
COPY --from=qvm /src/qvm/qvm /src/qvm/qvm

# install the missing apt requirements that can't be copied over
RUN echo "deb http://http.us.debian.org/debian/ testing non-free contrib main" >> /etc/apt/sources.list && \
apt-get update && apt-get -yq dist-upgrade && \
# install the missing apt that aren't copied over
RUN apt-get update && apt-get -yq dist-upgrade && \
apt-get install --no-install-recommends -yq \
clang-7 git libblas-dev libffi-dev liblapack-dev libzmq3-dev && \
rm -rf /var/lib/apt/lists/*
Expand Down