Docker Community Forums

Share and learn in the Docker community.

Where is Dockerfile located?

(Czezz) #1

Where can I find Dockerfile in my installation?

I have installed my first container by simply executing this: docker run -it ubuntu bash
Then I installed SSHd.
The problem is that every time I start container i need to manually start SSH service.

I have found very similar problem here:

The answer is to add startup command to Dockerfile. But how can I find this Docker file for my image?
I have scanned with “find” all file systems on my HOST and I see none.
Also cannot find path where my containers images are.

Little help for beginner please :slight_smile:

(Adamweb92) #2

The Dockerfile you need to create!

(Czezz) #3

Hi thanks for reply.
From what I see in your link and what I have found so far it looks like I need clone my new image out of another by using/creating Dockerfile. And (if my understanding is correct) Dockerfile is just one-time file where I specify changes/details for new image. Afterwords I can delete it.

Is that right?

(David Maze) #4

Afterwards you can commit it to source control and use it to rebuild your image when it changes.

If your plan is to set up an ssh daemon in your image so that you can connect to it and install software by hand, instead you should install the software in the Dockerfile and not install an sshd at all.