Dockerfile
Version vom 16. Juni 2021, 20:31 Uhr von Geist (Diskussion | Beiträge)
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"] CMD ["com","arg","arg"]
Overwrite CMD IP with robopagex.com
ENTRYPOINT ["/bin/ping"] CMD ["127.0.0.1"] docker run -it myalpine robopagex.com
CMD ["/bin/ping","127.0.0.1"] docker run -it myalpine robopagex.com
CMD ["/bin/ping","127.0.0.1"] docker run -it myalpine bash
FROM alpine:latest RUN mkdir -p /app COPY . /app
JUMP INTO WORKDIR
WORKDIR /app docker run -it myalpine
FROM alpine:latest ENV name TEST RUN echo "Hello, $name"
ENV nginx_conf /app/myconf.conf