Runtime container command as root
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- docker, shell
- Domain
- devops, infrastructure
Research direction
Start with the Dockerfile and debug.sh shown in the issue, then inspect how the container runs as user 1001 and how service ssh start uses /run/sshd. Reproduce the permission error with the open-liberty:21.0.0.7-kernel-slim-java8-openj9 image. Done means an agreed way to start SSH alongside the Liberty server without the /run/sshd permission failure.
Written by the indexing model from the issue text.
Description
I am trying to create a "debug" version of the OpenLiberty container to facilitate various troubleshooting. One of the items is to enable SSH and then run it at startup so the container can be remotely accessed. However, I'm running into permission problems with the Liberty user (uid 1001) and am wondering if someone can assist.
My Dockerfile has the following:
FROM open-liberty:21.0.0.7-kernel-slim-java8-openj9
USER root
COPY sshd_config /etc/ssh/
RUN apt-get update && apt-get install openssh-server -y && echo "root:xxx" | chpasswd
EXPOSE 22
USER 1001
COPY debug.sh /opt/scripts
CMD "/opt/scripts/debug.sh"
The debug.sh script has the following:
#!/bin/bash
service ssh start
/opt/ol/wlp/bin/server run defaultServer
The image build succeeds but when running the container, the script command service ssh start fails:
mkdir: cannot create directory ‘/run/sshd’: Permission denied
Can anyone advise/recommend on how to solve the issue? I'm not sure if installing sudo and configuring 1001 with no-password sudo ability is the correct approach--or if there's entirely another option.
Thank you!
- Dominant language
- Shell
- Stars
- 48
- Forks
- 60
- Avg merge
- 3h 2m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenLiberty/ci.docker
-
zenhub-dev
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenLiberty/ci.docker#747 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
OpenLiberty/ci.docker#649 · 10 comments ·
-
zenhub-dev
OpenLiberty/ci.docker#642 · 1 comment · 1 assignee ·
-
zenhub-dev
OpenLiberty/ci.docker#568 · 1 comment · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
OpenLiberty/ci.docker#567 · 9 comments ·
All issues in OpenLiberty/ci.docker
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·
-
docs(agents): strengthen the no-backslash-escaped-backticks rule with an issue-creation example Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
oSoWoSo/vOid_Community_repOsitory#148 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
chore
Difficulty 1/5 Under an hour Newbie friendliness 91/100
alunduil/alunduil-chezmoi#792 ·