Docker

Running commands on an image

$ docker run -it --entrypoint sh [imageId] 

Remove all images and containers

#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)

source: http://techoverflow.net/blog/2013/10/22/docker-remove-all-images-and-containers/arrow-up-right

Docker container sha value

docker inspect --format='{{index .RepoDigests 0}}' <docker-image> 

Remove all images with no tag

REPOSITORY                                                                TAG                 IMAGE ID            CREATED             SIZE
<none>                                                                    <none>              8ad635cb0348        22 hours ago        252.7 MB
<none>                                                                    <none>              2ae831215dd7        40 hours ago        252.7 MB

To remove the images that have no tag, e.g.

Run an image that was failing

Dockerfile

pulling an image using the sha

Finding the sha256

Getting the sha256 of a docker container 1arrow-up-right

Multi-stage builds

mount maven repository

Mount a maven repository using docker buildkit2arrow-up-right

on the command line:

In the Dockerfile, as the first line

In the Dockerfile, in the mvn run command

This will look like

Heap dumps from java

Use jattach

Command to use

Last updated