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.
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.
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.
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.
docker run -it ubuntu:16.04 bash
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With