0

My idea is to install Jenkins and Docker in the same Dockerfile since I have to complete CI/CD workflows. So, for now, my Dockerfile is... (very simple Dockerfile but it is just for now)

FROM jenkins/jenkins:lts

I'm facing a problem after building and running the container. I want to access the container by executing:

winpty docker attach CONTAINER_ID

But after executing this command, the console hangs and it's blocked.

Somebody know why is this happening? and the possible fix?

EDIT: After researching a little bit more, I've seen in the dockerfile for jenkins/jenkins:lts that it has ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/jenkins.sh"] command so that, when I try to access as I mentioned I only see this output, then the container does not redirect to bash. Is that correct? How can I go to bash?

2
  • Fixed by using: docker exec -it CONTAINER_ID bash
    – David M.
    Commented Apr 23, 2018 at 9:07
  • Add that on an answer, please.
    – CaldeiraG
    Commented Apr 23, 2018 at 10:25

1 Answer 1

3

Fixed by using:

docker exec -it CONTAINER_ID bash

If you use windows with winpty terminal:

winpty docker exec -it CONTAINER_ID bash

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .