Put a Dockerfile in the root of your project
docker build -t myproject .
The dot at the end tells Docker to look for the Dockerfile in the current directory
-t gives a name to the container image
docker run -ti --rm myproject
The "-ti" is necessary to see the container console output.
The "--rm" deletes any data the container made after it finishes running.
docker run -p 8080:80 -ti --rm myproject
Map TCP port 80 in the container to port 8080 on the Docker host.
When a container exits, all newly created data is lost. To persist data, the easiest way is to mount a shared directory between host and container
Use -v to specify the host:container paths to the shared directory
docker run -v $(PWD):/opt -ti myproject
This mounts the host working directory ($PWD) into the container's /opt directory
If you just want to mess about in empty container then you can just start a blank container
docker run -ti --rm ubuntu