Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Backend
Commits
64e5b460
Commit
64e5b460
authored
5 years ago
by
Erwan Rouchet
Committed by
Bastien Abadie
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Base image bootstrap script
parent
300503f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
Dockerfile
+2
-2
2 additions, 2 deletions
Dockerfile
Makefile
+2
-4
2 additions, 4 deletions
Makefile
base/Dockerfile
+4
-17
4 additions, 17 deletions
base/Dockerfile
base/bootstrap.sh
+8
-0
8 additions, 0 deletions
base/bootstrap.sh
with
17 additions
and
24 deletions
.gitlab-ci.yml
+
1
−
1
View file @
64e5b460
image
:
registry.gitlab.com/arkindex/backend:base-0.10.
1
image
:
registry.gitlab.com/arkindex/backend:base-0.10.
3
stages
:
-
test
-
build
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
2
−
2
View file @
64e5b460
...
...
@@ -12,7 +12,7 @@ RUN \
mkdir
/tmp/common
&&
\
wget
--header
"PRIVATE-TOKEN:
$GITLAB_TOKEN
"
https://gitlab.com/api/v4/projects/
$COMMON_ID
/repository/archive.tar.gz?sha
=
$COMMON_BRANCH
-O
/tmp/common/archive.tar.gz
&&
\
tar
--strip-components
=
1
-xvf
/tmp/common/archive.tar.gz
-C
/tmp/common
&&
\
cd
/tmp/common
&&
p
ython setup.py
install
&&
\
cd
/tmp/common
&&
p
ip
install
--disable-pip-version-check
--no-cache-dir
--quiet
.
&&
\
rm
-rf
/tmp/common
# Install arkindex-ponos from private repo
...
...
@@ -20,7 +20,7 @@ RUN \
mkdir
/tmp/ponos
&&
\
wget
--header
"PRIVATE-TOKEN:
$GITLAB_TOKEN
"
https://gitlab.com/api/v4/projects/
$PONOS_ID
/repository/archive.tar.gz?sha
=
$PONOS_BRANCH
-O
/tmp/ponos/archive.tar.gz
&&
\
tar
--strip-components
=
1
-xvf
/tmp/ponos/archive.tar.gz
-C
/tmp/ponos
&&
\
cd
/tmp/ponos
&&
p
ython setup.py
install
&&
\
cd
/tmp/ponos
&&
p
ip
install
--disable-pip-version-check
--no-cache-dir
--quiet
.
&&
\
rm
-rf
/tmp/ponos
# Install arkindex and its deps
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
2
−
4
View file @
64e5b460
...
...
@@ -6,17 +6,15 @@ COMMON_BRANCH=master
VERSION
=
$(
shell git rev-parse
--short
HEAD
)
TAG_APP
=
arkindex-app
TAG_BASE
=
arkindex-base
TAG_SHELL
=
arkindex-shell
.PHONY
:
build base
all
:
clean build
base
:
require-version
echo
$(
version
)
>
$(
ROOT_DIR
)
/VERSION
docker build
$(
ROOT_DIR
)
/base
-t
$(
TAG_BASE
)
:
$(
version
)
-t
$(
TAG_BASE
)
:latest
-t
registry.gitlab.com/arkindex/backend:base-
$(
version
)
docker build
$(
ROOT_DIR
)
/base
-t
registry.gitlab.com/arkindex/backend:base-
$(
version
)
docker push registry.gitlab.com/arkindex/backend:base-
$(
version
)
git commit
$(
ROOT_DIR
)
/VERSION
-m
'Bump to
$(
version
)
'
sed
-i
'/image:/s/base-.*$$/base-
$(
version
)
/'
$(
ROOT_DIR
)
/.gitlab-ci.yml
clean
:
rm
-rf
*
.egg-info build dist .eggs
...
...
This diff is collapsed.
Click to expand it.
base/Dockerfile
+
4
−
17
View file @
64e5b460
...
...
@@ -2,24 +2,11 @@ FROM python:3.6-alpine as base
FROM
base
as
staging
# Add system dependencies, use cache by copying requirements
RUN
apk add
--update
--no-cache
postgresql-dev jpeg-dev build-base
gzip
zlib-dev libmagic libxml2-dev libxslt-dev libffi-dev
RUN
apk add
--update
wget
gzip
libmagic git unzip libpq libxslt libjpeg imagemagick
# Install long buildtime deps
# Uses a source archive instead of full local copy to speedup docker build
ADD
requirements.txt /requirements.txt
RUN
pip
install
--install-option
=
"--prefix=/build"
-r
requirements.txt
# Restart from base, using staging build
FROM
base
# Import from staging the python build, so the final image is slimmer
# and has no build tool
COPY
--from=staging /build /usr
ENV
PYTHONPATH=/usr/lib/python3.6/site-packages
# Add runtime system deps
RUN
apk add
--update
--no-cache
wget
gzip
libmagic git unzip libpq libxslt libjpeg imagemagick
# Install python dependencies that are slow to install or require specific build deps
ADD
requirements.txt bootstrap.sh /
RUN
/bootstrap.sh
# Add unprivilegied user
RUN
addgroup
-g
1000 teklia
&&
adduser
-D
-u
1000
-G
teklia ark
...
...
This diff is collapsed.
Click to expand it.
base/bootstrap.sh
0 → 100755
+
8
−
0
View file @
64e5b460
#!/bin/sh
apk add
--virtual
build-dependencies postgresql-dev jpeg-dev build-base
gzip
zlib-dev libmagic libxml2-dev libxslt-dev libffi-dev
pip
install
--disable-pip-version-check
--no-cache-dir
--quiet
-r
requirements.txt
apk del build-dependencies
rm
-rf
/var/cache/apk/
*
rm
bootstrap.sh requirements.txt
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