Start sshd automatically with docker container

醉酒当歌 提交于 2019-11-29 05:32:38

You can try a more elegant way to do that with phusion/baseimage-docker

https://github.com/phusion/baseimage-docker#readme

Jia

Just try:

ENTRYPOINT service ssh restart && bash

in your dockerfile, it works fun for me!

more details here: How to automatically start a service when running a docker container?

You can start ssh server when starting your container probably. Something like this:

docker run ubuntu /usr/sbin/sshd -D

Check out this official tutorial.

Well, I used the following command to solve that

docker run -i -t  mycentos6 /bin/bash -c '/etc/init.d/sshd start && /bin/bash'
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!