DEV Community

Cover image for Dockerize SSH server using Dockerfile
Rajit Paul
Rajit Paul

Posted on

Dockerize SSH server using Dockerfile

Hope you are having a great day, let us begin this journey :D

Recently I came across a use case where I had to configure a web server on top of a docker container using Ansible, which means I had to set up an ssh server on top of the Docker container for Ansible to gain remote access and automate the configuration process.

So I went on the path of creating an SSH-enabled Docker Image using Dockerfile. We shall be using the Open SSH of the secure shell family in this use-case and centos: latest as the base image for our docker image.

Dockerfile -

Alt Text
You can download the pre-created docker image that I uploaded on Docker-Hub using
docker pull submar1n3/openssh:v1

You can also use the same code and create your own Docker Image -

Thanks for reading, cheers :D

Top comments (0)