Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
geomag-algorithms
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Geomagnetism Program
geomag-algorithms
Commits
0fedc98b
Commit
0fedc98b
authored
7 years ago
by
Jeremy M Fee
Browse files
Options
Downloads
Patches
Plain Diff
Use multi-stage build to remove gcc compiler from image
parent
c26fe480
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+17
-15
17 additions, 15 deletions
Dockerfile
with
17 additions
and
15 deletions
Dockerfile
+
17
−
15
View file @
0fedc98b
FROM
usgs/hazdev-base-images:latest-centos
MAINTAINER
Jeremy Fee <jmfee@usgs.gov>
LABEL
usgs.geomag-algorithms.version=0.4.0
FROM
usgs/hazdev-base-images:latest-centos
AS
pycurl-build
# install conda dependencies
RUN
yum
install
-y
\
...
...
@@ -12,7 +8,6 @@ RUN yum install -y \
&&
\
yum clean all
# install conda
ENV
PATH /conda/bin:$PATH
RUN
echo
'export PATH=/conda/bin:$PATH'
>
/etc/profile.d/conda.sh
&&
\
...
...
@@ -21,11 +16,6 @@ RUN echo 'export PATH=/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
/bin/bash ~/miniconda.sh
-b
-p
/conda
&&
\
rm
~/miniconda.sh
# copy library (ignores set in .dockerignore)
COPY
. /geomag-algorithms
# install algorithms and dependencies via conda
RUN
conda config
--set
ssl_verify
$SSL_CERT_FILE
&&
\
conda config
--add
channels obspy
&&
\
...
...
@@ -34,9 +24,22 @@ RUN conda config --set ssl_verify $SSL_CERT_FILE && \
# build pycurl with SFTP support
export PIP_CERT=$SSL_CERT_FILE && \
export PYCURL_SSL_LIBRARY=nss && \
pip install pycurl && \
# end build pycurl
pip install /geomag-algorithms && \
pip install pycurl
FROM
usgs/hazdev-base-images:latest-centos
MAINTAINER
Jeremy Fee <jmfee@usgs.gov>
LABEL
usgs.geomag-algorithms.version=0.4.0
# use conda install from build container
ENV
PATH /conda/bin:$PATH
COPY
--from=pycurl-build /conda /conda
COPY
--from=pycurl-build /etc/profile.d/conda.sh /etc/profile.d/conda.sh
# copy library (ignores set in .dockerignore)
COPY
. /geomag-algorithms
RUN
pip
install
/geomag-algorithms
&&
\
useradd
\
-c
'Docker image user'
\
-m
\
...
...
@@ -46,7 +49,6 @@ RUN conda config --set ssl_verify $SSL_CERT_FILE && \
mkdir
-p
/home/geomag_user/notebooks
&&
\
chown
-R
geomag_user:geomag_user /home/geomag_user
USER
geomag_user
WORKDIR
/home/geomag_user
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment