Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
nomad-lab
nomad-FAIR
Commits
4bb1c0d1
Commit
4bb1c0d1
authored
6 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Use alpine image as basis.
parent
e27eb55d
No related branches found
No related tags found
1 merge request
!7
Docker
Pipeline
#37288
failed
6 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+14
-23
14 additions, 23 deletions
Dockerfile
with
14 additions
and
23 deletions
Dockerfile
+
14
−
23
View file @
4bb1c0d1
...
@@ -20,13 +20,13 @@
...
@@ -20,13 +20,13 @@
# The dockerfile is multistaged to use a fat, more convinient build image and
# The dockerfile is multistaged to use a fat, more convinient build image and
# copy only necessities to a slim final image
# copy only necessities to a slim final image
# We use slim for the final image
FROM
alpine:3.6
FROM
python:3.6-slim
as
final
RUN
apk
--no-cache
--update-cache
--virtual
=
.build-dependencies add g++ gfortran file binutils musl-dev python3-dev openblas-dev libstdc++ openblas make
RUN
ln
-s
/usr/include/locale.h /usr/include/xlocale.h
RUN
ln
-s
/usr/bin/python3 /usr/bin/python
RUN
python
-m
ensurepip
RUN
ln
-s
/usr/bin/pip3 /usr/bin/pip
# First, build everything in a build image
FROM
python:3.6-stretch
as
build
# Make will be necessary to build the docs with sphynx
RUN
apt-get update
&&
apt-get
install
-y
make
RUN
mkdir
/install
RUN
mkdir
/install
WORKDIR
/install
WORKDIR
/install
# We also install the -dev dependencies, to use this image for test and qa
# We also install the -dev dependencies, to use this image for test and qa
...
@@ -44,26 +44,17 @@ RUN python nomad/dependencies.py
...
@@ -44,26 +44,17 @@ RUN python nomad/dependencies.py
RUN
ls
-la
.dependencies/parsers/vasp/
RUN
ls
-la
.dependencies/parsers/vasp/
RUN
ls
-la
.dependencies/parsers/vasp/vaspparser/
RUN
ls
-la
.dependencies/parsers/vasp/vaspparser/
# do that after the dependencies to use docker's layer caching
# do that after the dependencies to use docker's layer caching
COPY
. /
install
COPY
. /
app
RUN
pip
install
.
RUN
pip
app
.
WORKDIR
/
install
/docs
WORKDIR
/
app
/docs
RUN
make html
RUN
make html
RUN
\
RUN
\
find /usr/
local/
lib/python3.6/
-name
'tests'
-exec
rm
-r
'{}'
+
&&
\
find /usr/lib/python3.6/
-name
'tests'
-exec
rm
-r
'{}'
+
&&
\
find /usr/
local/
lib/python3.6/
-name
'test'
-exec
rm
-r
'{}'
+
&&
\
find /usr/lib/python3.6/
-name
'test'
-exec
rm
-r
'{}'
+
&&
\
find /usr/
local/
lib/python3.6/site-packages/
-name
'*.so'
-print
-exec
sh
-c
'file "{}" | grep -q "not stripped" && strip -s "{}"'
\;
find /usr/lib/python3.6/site-packages/
-name
'*.so'
-print
-exec
sh
-c
'file "{}" | grep -q "not stripped" && strip -s "{}"'
\;
# Second, create a slim final image
RUN
rm
/usr/include/xlocale.h
&&
\
FROM
final
apk del .build-dependencies
# copy the sources for tests, coverage, qa, etc.
COPY
. /app
WORKDIR
/app
# transfer installed packages from dependency stage
COPY
--from=build /usr/local/lib/python3.6/site-packages /usr/local/lib/python3.6/site-packages
# copy the meta-info, since it files are loaded via relative paths. TODO that should change.
COPY
--from=build /install/.dependencies/nomad-meta-info /app/.dependencies/nomad-meta-info
# copy the documentation, its files will be served by the API
COPY
--from=build /install/docs/.build /app/docs/.build
RUN
mkdir
-p
/app/.volumes/fs
RUN
mkdir
-p
/app/.volumes/fs
RUN
mkdir
-p
/nomad
RUN
mkdir
-p
/nomad
...
...
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