Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
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
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
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
Georg Abenthung
funkwhale
Commits
df62cb8f
Commit
df62cb8f
authored
5 years ago
by
R En
Committed by
Eliot Berriot
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove build dependencies to lighten docker image
parent
0ffec0ee
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/Dockerfile
+28
-11
28 additions, 11 deletions
api/Dockerfile
changes/changelog.d/docker-reduced-size.enhancement
+1
-0
1 addition, 0 deletions
changes/changelog.d/docker-reduced-size.enhancement
with
29 additions
and
11 deletions
api/Dockerfile
+
28
−
11
View file @
df62cb8f
FROM
alpine:3.10
FROM
alpine:3.10
as
builder
RUN
\
echo
'installing dependencies'
&&
\
apk add
--no-cache
\
bash
\
apk add
--no-cache
\
git
\
gettext
\
musl-dev
\
gcc
\
postgresql-dev
\
python3-dev
\
py3-psycopg2
\
py3-pillow
\
libldap
\
ffmpeg
\
libpq
\
libmagic
\
libffi-dev
\
make
\
zlib-dev
\
jpeg-dev
\
openldap-dev
\
&&
\
\
ln
-s
/usr/bin/python3 /usr/bin/python
# create virtual env for next stage
RUN
python
-m
venv /venv
# emulate activation by prefixing PATH
ENV
PATH="/venv/bin:$PATH" VIRTUAL_ENV=/venv
RUN
mkdir
/requirements
COPY
./requirements/base.txt /requirements/base.txt
# hack around https://github.com/pypa/pip/issues/6158#issuecomment-456619072
ENV
PIP_DOWNLOAD_CACHE=/noop/
RUN
\
echo
'fixing requirements file for alpine'
&&
\
sed
-i
'/Pillow/d'
/requirements/base.txt
&&
\
\
echo
'installing pip requirements'
&&
\
pip3
install
--upgrade
pip
&&
\
pip3
install
setuptools wheel
&&
\
...
...
@@ -43,6 +40,26 @@ COPY ./requirements/*.txt /requirements/
RUN
\
if
[
"
$install_dev_deps
"
=
"1"
]
;
then
echo
"Installing dev dependencies"
&&
pip3
install
--no-cache-dir
-r
/requirements/local.txt
-r
/requirements/test.txt
;
else
echo
"Skipping dev deps installation"
;
fi
FROM
alpine:3.10
as
build-image
COPY
--from=builder /venv /venv
# emulate activation by prefixing PATH
ENV
PATH="/venv/bin:$PATH"
RUN
apk add
--no-cache
\
libmagic
\
bash
\
gettext
\
python3
\
jpeg-dev
\
ffmpeg
\
libpq
\
&&
\
\
ln
-s
/usr/bin/python3 /usr/bin/python
ENTRYPOINT
["./compose/django/entrypoint.sh"]
CMD
["./compose/django/server.sh"]
...
...
This diff is collapsed.
Click to expand it.
changes/changelog.d/docker-reduced-size.enhancement
0 → 100644
+
1
−
0
View file @
df62cb8f
Reduced size of funkwhale/funkwhale docker images thanks to multi-stage builds (!1042)
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