×
☰ See All Chapters

Docker LABEL command

The docker LABEL command can be used to add extra information to the image. This information can be author information, description of the image. You can add any number of LABEL commands.

FROM openjdk:13-jdk-alpine

LABEL maintainer="Manu Manjunatha <manu.m@java4coding.com>"

LABEL description="This example Dockerfile installs NGINX."

ARG JAR_FILE=target/*.jar

COPY ${JAR_FILE} app.jar

ENTRYPOINT ["java","-jar","/app.jar"]

You can view the containers' labels with the docker inspect command:

docker image inspect <IMAGEID>

You can get the image Id by running “docker image ls” command.

docker-label-command-0
 
docker-label-command-1
 

All Chapters
Author