mirror of
https://github.com/mveril/qp-demo
synced 2024-08-25 05:51:47 +02:00
Unpack quantum package in another stage to have a lighter image
This commit is contained in:
parent
240b42f113
commit
22a1d76ef2
12
Dockerfile
12
Dockerfile
@ -30,6 +30,11 @@ RUN ./configure -i all -c config/gfortran_avx.cfg
|
|||||||
# Compile the code to a static build
|
# Compile the code to a static build
|
||||||
RUN /bin/bash -c "source quantum_package.rc ; qp export_as_tgz"
|
RUN /bin/bash -c "source quantum_package.rc ; qp export_as_tgz"
|
||||||
|
|
||||||
|
# Used to unpack QP2
|
||||||
|
FROM ubuntu:20.04 AS unpack
|
||||||
|
WORKDIR /tmp
|
||||||
|
COPY --from=builder /home/builder/qp2/quantum_package_static.tar.gz .
|
||||||
|
RUN tar -xf quantum_package_static.tar.gz
|
||||||
|
|
||||||
# This image is based from Ubuntu LTS
|
# This image is based from Ubuntu LTS
|
||||||
FROM ubuntu:20.04
|
FROM ubuntu:20.04
|
||||||
@ -66,10 +71,9 @@ ENV USER=$user
|
|||||||
WORKDIR /home/$user
|
WORKDIR /home/$user
|
||||||
# Copy examples
|
# Copy examples
|
||||||
COPY --chown=$user:$user examples examples
|
COPY --chown=$user:$user examples examples
|
||||||
# Copy QP2 static from build
|
# Copy unpacked QP2 static
|
||||||
COPY --from=builder --chown=$user:$user /home/builder/qp2/quantum_package_static.tar.gz .
|
RUN mkdir qp2
|
||||||
# Extract static build
|
COPY --from=unpack --chown=$user:$user /tmp/quantum_package_static ./qp2
|
||||||
RUN tar -xf quantum_package_static.tar.gz && mv quantum_package_static qp2 && rm quantum_package_static.tar.gz
|
|
||||||
RUN echo "set -g default-command /home/$user/qp2/bin/qpsh" >> .tmux.conf
|
RUN echo "set -g default-command /home/$user/qp2/bin/qpsh" >> .tmux.conf
|
||||||
RUN echo "shell \"/home/$user/qp2/bin/qpsh\"" >> .screenrc
|
RUN echo "shell \"/home/$user/qp2/bin/qpsh\"" >> .screenrc
|
||||||
# start a qp shell when run
|
# start a qp shell when run
|
||||||
|
Loading…
Reference in New Issue
Block a user