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
3ee37ab2
Commit
3ee37ab2
authored
3 years ago
by
Jeremy M Fee
Browse files
Options
Downloads
Patches
Plain Diff
Update docker build to use new usgs/python:3.8-obspy image
parent
2c8458a4
No related branches found
No related tags found
2 merge requests
!146
Release CMO metadata to production
,
!123
Poetry
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+5
-55
5 additions, 55 deletions
Dockerfile
with
5 additions
and
55 deletions
Dockerfile
+
5
−
55
View file @
3ee37ab2
ARG
FROM_IMAGE=usgs/
centos:7
ARG
FROM_IMAGE=usgs/
python:3.8-obspy
################################################################################
# base python image
FROM
${FROM_IMAGE}
as
python
ARG
PYTHON_VERSION=38
LABEL
maintainer="Jeremy Fee <jmfee@usgs.gov>"
# put rh-python38 at start of path
ENV
PATH="/opt/rh/rh-python38/root/usr/bin:/opt/rh/rh-python38/root/usr/local/bin:${PATH}"
# configure ssl intercept
ENV
PIP_CERT="${SSL_CERT_FILE}"
ENV
REQUESTS_CA_BUNDLE="${SSL_CERT_FILE}"
RUN
yum
install
-y
\
centos-release-scl
\
glibc-langpack-en
\
which
\
&&
yum
install
-y
rh-python
${
PYTHON_VERSION
}
\
&&
python
-m
pip
install
-U
\
pip
\
poetry
\
wheel
\
&&
yum clean all
################################################################################
# python builder image
FROM
python
as
obspy
ARG
PYTHON_VERSION=38
# build with compilers in separate stage
RUN
yum groupinstall
-y
"Development Tools"
RUN
yum
install
-y
rh-python
${
PYTHON_VERSION
}
-python-devel
ENV
LD_LIBRARY_PATH="/opt/rh/rh-python${PYTHON_VERSION}/root/usr/lib64"
ENV
PKG_CONFIG_PATH="/opt/rh/rh-python${PYTHON_VERSION}/root/usr/lib64/pkgconfig"
# obspy
RUN
python
-m
pip wheel obspy
--wheel-dir
/wheels
# pycurl
RUN
yum
install
-y
libcurl-devel openssl-devel
RUN
export
PYCURL_SSL_LIBRARY
=
nss
\
&&
python
-m
pip wheel pycurl
--wheel-dir
/wheels
################################################################################
# geomag-algorithms image
FROM
python
FROM
${FROM_IMAGE}
ARG
GIT_BRANCH_NAME=none
ARG
GIT_COMMIT_SHA=none
...
...
@@ -61,9 +12,8 @@ ENV GIT_BRANCH_NAME=${GIT_BRANCH_NAME} \
GIT_COMMIT_SHA=${GIT_COMMIT_SHA} \
WEBSERVICE=${WEBSERVICE}
# install obspy and pycurl using wheels
COPY
--from=obspy /wheels /wheels
RUN
python
-m
pip
install
--find-links
file:///wheels obspy pycurl
# install to system python
USER
root
# install packages when dependencies change
COPY
pyproject.toml poetry.lock /geomag-algorithms/
...
...
@@ -73,7 +23,7 @@ RUN cd /geomag-algorithms \
# only install dependencies, not project
&& poetry install --no-root
# install rest of library
as editable
# install rest of library
separate from dependencies
COPY
. /geomag-algorithms
RUN
cd
/geomag-algorithms
\
# now install project to install scripts
...
...
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