Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rosetta
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
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ExaCT
Rosetta
Commits
0345220c
Commit
0345220c
authored
3 years ago
by
Stefano Alberto Russo
Browse files
Options
Downloads
Patches
Plain Diff
Refactored the standalone worker users: rosetta is now uid 1000, testuser is uid 1001.
parent
05f8d620
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
services/standaloneworker/Dockerfile
+27
-37
27 additions, 37 deletions
services/standaloneworker/Dockerfile
services/standaloneworker/subgid
+1
-1
1 addition, 1 deletion
services/standaloneworker/subgid
services/standaloneworker/subuid
+1
-1
1 addition, 1 deletion
services/standaloneworker/subuid
with
29 additions
and
39 deletions
services/standaloneworker/Dockerfile
+
27
−
37
View file @
0345220c
FROM
quay.io/podman/stable:v3.2.3
#RUN dnf repolist
#RUN dnf update --refresh
# This is necessary due to some base image permission errors.
RUN
chown
-R
podman:podman /home/podman
# Change user
RUN
usermod
-l
testuser
podman
RUN
usermod
-d
/
home/testuser testuser
RUN
ln
-s
/home/podman /
home/testuser
RUN
groupmod
-n
testuser
podman
# Change user
, from podman to rosetta
RUN
usermod
-l
rosetta
podman
RUN
usermod
-d
/
rosetta rosetta
RUN
ln
-s
/home/podman /
rosetta
RUN
groupmod
-n
rosetta
podman
# Replace uid/gid mapping from podman to
testuser
user
# Replace uid/gid mapping from podman to
rosetta
user
COPY
subuid /etc/subuid
COPY
subgid /etc/subgid
#RUN dnf repolist
#RUN dnf update --refresh
RUN
dnf
install
-y
docker singularity openssh-server
RUN
ssh-keygen
-A
RUN
mkdir
/home/testuser/.ssh
COPY
keys/id_rsa.pub /home/testuser/.ssh/authorized_keys
RUN
dnf
install
-y
python wget
# Install iputils (fpr ping) and openssh-clients (for scp)
RUN
dnf
install
-y
iputils openssh-clients
# Copy registries.conf to allow insecure access to dregistry
COPY
registries.conf /etc/containers/registries.conf
#------------------------
# Rosetta user
#------------------------
# Add group. We chose GID 1001 as higher GIDs (i.e. 65527) raise issues with Podman GIDs namespace mapping.
RUN
groupadd
-g
1001 rosetta
# Authorized keys for rosetta
RUN
mkdir
/rosetta/.ssh
COPY
keys/id_rsa.pub /rosetta/.ssh/authorized_keys
# Add user. We chose UID 1001 as higher UIDs (i.e. 65527) raise issues with Podman UIDs namespace mapping.
RUN
useradd rosetta
-d
/rosetta
-u
1001
-g
1001
-m
-s
/bin/bash
#RUN ssh-keygen -A
# Add rosetta user to sudoers
RUN
usermod
-aG
wheel rosetta
# Passwordless sudo
# Passwordless sudo
(for everyone)
RUN
sed
-e
's;^# \(%wheel.*NOPASSWD.*\);\1;g'
-i
/etc/sudoers
# Authorized keys
RUN
mkdir
/rosetta/.ssh
COPY
keys/id_rsa.pub /rosetta/.ssh/authorized_keys
# Add testuser user
RUN
groupadd
-g
1001 testuser
RUN
useradd testuser
-d
/home/testuser
-u
1001
-g
1001
-m
-s
/bin/bash
# Authorized keys for testuser
RUN
mkdir
/home/testuser/.ssh
COPY
keys/id_rsa.pub /home/testuser/.ssh/authorized_keys
#----------------------
# Entrypoint
#----------------------
# Install Docker, Singularity, various utilities including iputils (for ping) and openssh-clients (for scp)
RUN
dnf
install
-y
docker singularity openssh-server python wget iputils openssh-clients
# Copy registries.conf to allow insecure access to internal/dev registries
COPY
registries.conf /etc/containers/registries.conf
# Copy entrypoint
COPY
entrypoint.sh /
...
...
This diff is collapsed.
Click to expand it.
services/standaloneworker/subgid
+
1
−
1
View file @
0345220c
testuser:10000:5000
\ No newline at end of file
rosetta:10000:5000
\ No newline at end of file
This diff is collapsed.
Click to expand it.
services/standaloneworker/subuid
+
1
−
1
View file @
0345220c
testuser:10000:5000
\ No newline at end of file
rosetta:10000:5000
\ No newline at end of file
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