Page tree
Skip to end of metadata
Go to start of metadata

Resources

Documenten


Commando's

docker images

docker container ls

docker ps

docker ps -aq

docker run hello-world

docker run ubuntu echo ‘Hello World!’

docker run -it ubuntu bash


Dockerfile:

FROM ubuntu
RUN echo ‘Setting up…’


docker build .

docker build . -t demo:ubuntu

docker run demo:ubuntu


Dockerfile:

FROM ubuntu
RUN echo 'Setting up…'
RUN apt update -y && apt upgrade -y
RUN apt install -y cowsay
ENV PATH "$PATH:/usr/games"
RUN echo 'Done.'


docker build . -t demo:cow

docker run demo:cow cowsay Hallo


Dockerfile:

FROM ubuntu

RUN echo 'Setting up…'

RUN apt update -y && apt upgrade -y

RUN apt install -y cowsay

ENV PATH "$PATH:/usr/games"

COPY say.sh /root/say.sh

RUN echo 'Done.'


say.sh:

#!/bin/sh
cowsay Hallo


chmod +x say.sh

docker build . -t demo:cow-script

docker run demo:cow-script  '/root/say.sh'


mkdir html && cd html

nano index.html


Dockerfile:

FROM nginx:alpine

RUN echo 'Setting up…'

COPY html /usr/share/nginx/html

RUN echo 'Done.'


docker run -p 8080:80 demo:website

-> localhost:8080

docker run -d -p 8080:80 demo:website

docker ps

  • No labels