Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start up docker container without dockerfile

Tags:

docker

I've been using Dockerfiles so often that I've forgotten how to start up a new one without one.

I was reading https://docs.docker.com/engine/reference/commandline/start/ and ofc it doesn't state how to start up a new one.

like image 426
basickarl Avatar asked Jan 25 '17 18:01

basickarl


People also ask

How do I start a container in Docker?

Start an app container To do so, you will use the docker run command. You use the -d flag to run the new container in “detached” mode (in the background). You also use the -p flag to create a mapping between the host's port 3000 to the container's port 3000.

Does Dockerfile have to start with from?

The FROM instruction initializes a new build stage and sets the Base Image for subsequent instructions. As such, a valid Dockerfile must start with a FROM instruction. The image can be any valid image – it is especially easy to start by pulling an image from the Public Repositories.

Can Docker Compose work without Dockerfile?

You re right, Dockerfile is not necessary. Docker Compose uses YAML file, typically named docker-compose. yml to define what your mutliple-container application should look like.


1 Answers

docker run -it ubuntu:16.04 bash
like image 126
basickarl Avatar answered Sep 30 '22 10:09

basickarl