The "magical" whale.
- Remove existing image, if needed. See "Misc commands" for details.
- Build the new image
docker build -t app .
- Find the image ID
docker images
docker run -t -d --name my_app <image ID>
- See below for information on how to test the image.
docker tag app registry.gitlab.com/org/repo/php:latest
- Push the image to GitLab container repository
docker push registry.gitlab.com/org/repo/php
- Start a container, named "my_app"
docker run -t -d --name my_app app
- Open the command line within the container
docker exec -it my_app bash
- Stop the container
docker stop my_app app
- View available images
docker images
- Remove an image
docker rmi <IMAGE_ID>
- Remove a container
docker rm <CONTAINER_ID or CONTAINER_NAME>