Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENTRYPOINT ["setup-sshd"] in docker files #101

Open
eliorm32 opened this issue Feb 13, 2022 · 1 comment
Open

ENTRYPOINT ["setup-sshd"] in docker files #101

eliorm32 opened this issue Feb 13, 2022 · 1 comment
Labels

Comments

@eliorm32
Copy link

Jenkins and plugins versions report

Environment
Paste the output here

What Operating System are you using (both controller, and any agents involved in the problem)?

ubuntu 20.04

Reproduction steps

  1. build image from dockerfile: https://github.com/jenkinsci/docker-ssh-agent/blob/master/11/bullseye/Dockerfile
  2. run container

Expected Results

container should run with args

Actual Results

docker container fails to start:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "setup-sshd": executable file not found in $PATH: unknown.
ERRO[0000] error waiting for container: context canceled

Anything else?

in docker file either add:

RUN echo "PATH=${PATH}" >> /etc/environment
COPY setup-sshd /usr/local/bin/setup-sshd
RUN chmod +x /usr/local/bin/setup-sshd

EXPOSE 22

ENTRYPOINT ["setup-sshd"]

or

RUN echo "PATH=${PATH}" >> /etc/environment
COPY setup-sshd /usr/local/bin/setup-sshd


EXPOSE 22

ENTRYPOINT ["bash","setup-sshd"]
@eliorm32 eliorm32 added the bug label Feb 13, 2022
@dduportal
Copy link
Contributor

The root cause is that the setup-sshd does not have the executable bit when you ran the command docker build (there could be numerous reasons: a git repository that removed the bit when cloned, a umask, an archive with no bit, a shared filesystem, etc.).

However you make a good point: setting the entrypoint ot make an explicit call to bash would help.
Any signals would still be propagated to the shell script with this form, and that would ensure that end user can override the default user as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants