Can any one guide me how to create and edit a Dockerfile in boot2docker to create my own image? I am not sure which commands to use to edit the Dockerfile when in Boot2Docker shell.
2 Answers
I wonder why you are looking to create your Dockerfile directly from the boot2docker shell. Once boot2docker is installed on your computer, you can directly create normally a Dockerfile from your shell. To do so, follow my steps :
Launch boot2docker and exports the env variables as requested (copy and paste the last three lines)
Write the simplest test Dockerfile you can!
Build it (we will call our image 'test')
Let's run our image
Now you just have to adapt my example to do what you want. Keep in mind that in this example the container we launched is now stopped because nothing kept it alive. For most common cases, you will have something (like a server) which will keep your container running. I hope it will help you!

- 516
- 4
- 10
-
i am running boot2docker on a windows machine so when i directly launch the application i get connected to the boot2docker shell via ssh with docker@boot2docker as the root directory i am able to perform all the other docker operations like pull push run etc but i dont know how i would create my own Dockerfile and write the specific commands – Abhishek Pandey Feb 06 '15 at 09:52
A Dockerfile is simply a text file with line-by-line instructions to build an image. So you edit it with any text editor.
See the Docker page for further details on what to put inside.

- 11,398
- 3
- 53
- 78