Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
silkaj
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
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
python
silkaj
Commits
155d7c4a
Commit
155d7c4a
authored
4 years ago
by
Moul
Browse files
Options
Downloads
Patches
Plain Diff
[wip]
#388
: Dockerfile into two steps
parent
824b894e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+26
-3
26 additions, 3 deletions
Dockerfile
with
26 additions
and
3 deletions
Dockerfile
+
26
−
3
View file @
155d7c4a
FROM
registry.duniter.org/docker/python3/poetry/3.9:latest
# ------------------------------------------------------------------------------
# Build Stage
# ------------------------------------------------------------------------------
FROM
registry.duniter.org/docker/python3/poetry/3.9:latest
as
build
WORKDIR
/silkaj
RUN
ls
&&
ls
silkaj
# Copy source tree
COPY
./ ./
# Install Silkaj
RUN
poetry
install
# ------------------------------------------------------------------------------
# Final Stage
# ------------------------------------------------------------------------------
FROM
registry.duniter.org/docker/python3/poetry/3.9:latest
# Create silkaj group and user
RUN
addgroup
-S
-g
1111 silkaj
&&
\
adduser
-SD
-h
/silkaj
-G
silkaj
-u
1111 silkaj
# Copy the build artifact from the build stage
COPY
--from=build --chown=silkaj:silkaj /silkaj /silkaj
# Set up alias to directly get silkaj command
# https://stackoverflow.com/a/3638886
RUN
printf
'#!/bin/bash\npoetry run silkaj "$@"'
>
/usr/bin/silkaj
&&
\
chmod
+x /usr/bin/silkaj
chmod
+x /usr/bin/silkaj
&&
\
chown
silkaj: /usr/bin/silkaj
# Use silkaj user
USER
silkaj
WORKDIR
/silkaj
CMD
["/usr/bin/silkaj"]
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