Dockerfile: Unterschied zwischen den Versionen

Aus robopagex.com
Zur Navigation springen Zur Suche springen
Zeile 12: Zeile 12:
 
   '' LABEL maintainer="robopagex.com" ''
 
   '' LABEL maintainer="robopagex.com" ''
  
 +
''RUN execute on build, multiple run possible''
 +
  '' RUN echo "HELLO" ''
 
   '' RUN apt-get update && \ ''
 
   '' RUN apt-get update && \ ''
 
   ''    apt-get upgrade -y ''
 
   ''    apt-get upgrade -y ''
''RUN execute on build, multiple run possible''
 
  
  '' CMD ["/bin/bash"]''
+
 
 
''Only one at the end''
 
''Only one at the end''
 +
  '' CMD ["/bin/bash"] ''
 +
  '' CMD ["echo","Hello"] ''

Version vom 16. Juni 2021, 19:27 Uhr

Dockerfile

Erstellen eines Docker Image

 Dockerfile >> *Build* >> Docker Image >> *Run* >>> Docker Container

# BASIS IMAGE

  FROM alpine:latest 
  LABEL name="test alpine" 
  LABEL version="1.0" 
  LABEL description="a new alpine image" 
  LABEL maintainer="robopagex.com" 

RUN execute on build, multiple run possible

  RUN echo "HELLO" 
  RUN apt-get update && \ 
      apt-get upgrade -y 


Only one at the end

  CMD ["/bin/bash"] 
  CMD ["echo","Hello"]