Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Software Heritage virtual environment packaging manifests
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
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
Platform
Infrastructure
Software Heritage virtual environment packaging manifests
Commits
6e005883
Unverified
Commit
6e005883
authored
2 months ago
by
Antoine R. Dumont
Browse files
Options
Downloads
Patches
Plain Diff
alter: Adapt image to reuse the swh-base docker image
Refs.
sysadm-environment#5560
parent
cc056780
Loading
Loading
1 merge request
!51
swh-apps: Bump swh-* images to use python:3.11-bookworm
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/swh-alter/Dockerfile
+15
-23
15 additions, 23 deletions
apps/swh-alter/Dockerfile
with
15 additions
and
23 deletions
apps/swh-alter/Dockerfile
+
15
−
23
View file @
6e005883
FROM
python:3.11-bookworm
ARG
REGISTRY=container-registry.softwareheritage.org/swh/infra/swh-apps/
ARG
base_image=${REGISTRY}swh-base
ARG
base_image_version=latest
FROM
${base_image}:${base_image_version}
ARG
userid=1000
ARG
groupid=1000
ARG
user=swh
ARG
workdir=/opt/${user}
ARG
venv=${workdir}/venv
ARG
configdir=/etc/${user}
RUN
apt-get
-y
update
&&
\
USER
root
RUN
apt-get update
&&
\
apt-get
-y
upgrade
&&
\
apt-get
install
-y
\
curl
\
...
...
@@ -25,15 +26,13 @@ RUN apt-get -y update && \
telnet
\
tmux
\
vim
&&
\
apt clean
&&
\
addgroup
--gid
${
userid
}
swh
&&
\
useradd
--gid
${
groupid
}
--uid
${
userid
}
-m
-d
${
workdir
}
${
user
}
&&
\
mkdir
${
configdir
}
apt-get clean
USER
swh
RUN
python
-m
venv
${
venv
}
WORKDIR
${workdir}
COPY
--chmod=0644 requirements-frozen.txt ${workdir}
RUN
--mount
=
type
=
cache,target
=
.cache,uid
=
1000,gid
=
1000
\
uv pip
sync
requirements-frozen.txt
USER
${user}
ENV
CARGO_HOME="${workdir}/.cargo"
ENV
RUSTUP_HOME="${workdir}/.rustup"
...
...
@@ -48,16 +47,9 @@ ENV PATH="${CARGO_HOME}/bin:${PATH}"
# Use the latest available version so we can detect if rage behavior has changed when
# testing swh-alter. Otherwise, this might only be detected when processing a
# takedown notice or restoring a bundle… which would not be a nice experience.
RUN
cargo
install
rage
ENV
PYTHONPATH=${venv}
ENV
PATH=${venv}/bin:$PATH
RUN
python
-m
pip
install
uv
COPY
--chown=${userid}:${groupid} requirements-frozen.txt ${workdir}
RUN
uv pip
sync
--no-cache
requirements-frozen.txt
RUN
--mount
=
type
=
cache,target
=
.cache,uid
=
1000,gid
=
1000
\
cargo
install
rage
COPY
--chown=${userid}:${groupid} entrypoint.sh ${workdir}
RUN
chmod
u+x
${
workdir
}
/entrypoint.sh
COPY
--chmod=0755 entrypoint.sh ${workdir}
ENTRYPOINT
["/opt/swh/entrypoint.sh"]
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