05. Dockerfile Example
October 23, 2024Less than 1 minute
Make Dockerfile
From centos
MAINTAINER why<nutterair1989@gmail.com>
ENV MYPATH /usr/local
WORKDIR $MYPATH
RUN yum -y install vim
RUN yum -y install net-tools
RUN yum -y install glibc.i686
RUN mkdir /usr/local/java
ADD jdk-8u171-linux-x64.tar.gz /usr/local/java
ENV JAVA_HOME /usr/local/java/jdk1.8.0_171
ENV JRE_HOME $JAVA_HOME/jre
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASSPATH
ENV PATH $JAVA_HOME/bin:$PATH
EXPOSE 80
Build Dockerfile
docker build -t centosjava8:1.5 .
Dangling Image
Both repo and tag are <none>
is dangling image, which will happened during deleting or building a dockerfile.
List all dangling images
docker image ls -f dangling=true
Delete all dangling images
docker image prune