skip to Main Content

could you help me?

I’m trying to run a container by a dockerfile but it shows this
warning and my container does not start.

compose.parallel.parallel_execute_iter: Finished processing:
<Container: remote-Starting remote-host … done

compose.parallel.feed_queue: Pending: set()

compose.parallel.parallel_execute_iter: Finished processing: <Service:
remote_host>

compose.parallel.feed_queue: Pending: set()

Attaching to jenkinks, remote-host

compose.cli.verbose_proxy.proxy_callable: docker logs <-
(‘f2e305942e57ce1fe90c2ca94d3d9bbc004155a136594157e41b7a916d1ca7de’,
stdout=True, stderr=True, stream=True, follow=True)

remote-host | Unable to load host key: /etc/ssh/ssh_host_rsa_key
remote-host | Unable to load host key: /etc/ssh/ssh_host_ecdsa_key
remote-host | Unable to load host key:
/etc/ssh/ssh_host_ed25519_key remote-host | sshd: no hostkeys
available — exiting.

compose.cli.verbose_proxy.proxy_callable: docker events <-
(filters={‘label’: [‘com.docker.compose.project=jenkins’,
‘com.docker.compose.oneoff=False’]}, decode=True)

My dockerfile is this:

FROM centos RUN yum -y install openssh-server RUN yum install -y
passwd RUN useradd remote_user &&
echo "1234" | passwd remote_user –stdin &&
mkdir /home/remote_user/.ssh &&
chmod 700 /home/remote_user/.ssh COPY remote_user.pub /home/remote_user/.ssh/authorized_keys RUN chown
remote_user:remote_user -R /home/remote_user &&
chmod 400 /home/remote_user/.ssh/authorized_keys CMD /usr/sbin/sshd -D

2

Answers


  1. start with an empty dir and put following in that dir as a file called Dockerfile

    FROM centos
    
    RUN yum -y install openssh-server 
    RUN yum install -y passwd 
    RUN useradd remote_user
    
    RUN echo "1234" | passwd remote_user --stdin 
    
    RUN mkdir /home/remote_user/.ssh
    
    
    RUN chmod 700 /home/remote_user/.ssh
    
    COPY remote_user.pub /home/remote_user/.ssh/authorized_keys
    RUN chown remote_user:remote_user -R /home/remote_user 
    
    RUN chmod 400 /home/remote_user/.ssh/authorized_keys
    CMD /usr/sbin/sshd -D
    
    
    # CMD ["/bin/bash"]
    
    
    # ... save this file as Dockerfile then in same dir issue following
    #
    # docker build --tag stens_centos .   # creates image stens_ubuntu
    #
    # docker run -d  stens_centos  sleep infinity # launches container and just sleeps only purpose here is to keep container running
    #
    # docker ps     #   show running containers
    #
    # 
    # ... find CONTAINER ID from above and put into something like this
    #
    # docker exec -ti $( docker ps | grep stens_centos | cut -d' ' -f1 ) bash   #  login to running container
    #
    

    then in that same dir put your ssh key files as per

    eve@milan ~/Dropbox/Documents/code/docker/centos $ ls -la
    total 28
    drwxrwxr-x  2 eve eve  4096 Nov  2 15:20 .
    drwx------ 77 eve eve 12288 Nov  2 15:14 ..
    -rw-rw-r--  1 eve eve   875 Nov  2 15:20 Dockerfile
    -rwx------  1 eve eve  3243 Nov  2 15:18 remote_user
    -rwx------  1 eve eve   743 Nov  2 15:18 remote_user.pub
    

    then cat out Dockerfile and copy and paste commands it explains at bottom of Dockerfile file … for me all of them just worked OK

    after I copy and pasted those commands listed at bottom of Dockerfile the container gets built and executed

    docker ps
      
    CONTAINER ID   IMAGE          COMMAND            CREATED         STATUS         PORTS     NAMES
    0a06ebd2752a   stens_centos   "sleep infinity"   7 minutes ago   Up 7 minutes             pedantic_brahmagupta
    

    keep in mind you must define in your Dockerfile the bottom CMD or similar to be just what you want to get executed as the container runs which typically is a server which by definition runs forever … alternatively this CMD can be simply something which runs then finishes like a batch job in which case the container will exit when that job finishes … with this knowledge I suggest you confirm sshd -D will hold that command as a server or will immediately terminate upon launch of container

    Login or Signup to reply.
  2. I’ve just replied to this GitHub issue, but here’s what I experienced and how I fixed it

    I just had this issue for my Jekyll blog site which I normally bring up using docker-compose with mapped volume to rebuild when I create a new post – it was hanging, tried to run docker-compose up with the --verbose switch and saw the same compose.parallel.feed_queue: Pending: set().

    I tried it on my Macbook and it was working fine

    I didn’t have any experimental features turned on, but I need need to go into (on Windows) settings-> resources -> File Sharing and add the folder I was mapping in my docker compose (the root of my blog site)

    Re ran docker compose and its now up and running

    Version Info:
    image

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search