Skip to content

Dockerfile

Nicolas Bonnand edited this page Sep 12, 2018 · 23 revisions

11.1 Dockerfile

If you don't have any docker image, you can build one with a dockerfile. diag

  • a Select "Docker" tab
  • b Select "Docker image" tab
  • c Enter a name for your new image: for example "fedora01"

Use dockerfile editor to create a dockerfile: (push d or e to add or remove line , f or g to move line up or down.)

  • j Click on a line and enter text following dockerfile usual syntax. First column is for dockerfile commands (Begin to type and command autocompletion will guide you...). Second column is for dockerfile command arguments.

Find below an example of dockerfile syntax for a fedora image:

FROM docker.io/fedora
RUN dnf -y update iproute \
	   openssh-clients \
	   wget \
	   curl \
	   iputils \
	   traceroute \
	   iperf \
	   wireshark \
	   tcpdump \
	   procps-ng \
	   scapy \  
  	   net-tools \
	   lsof \	
	   lighttpd
RUN dnf -y install iproute \
	   openssh-clients \
	   wget \
	   curl \
	   iputils \
	   traceroute \
	   iperf \
	   wireshark \
	   tcpdump \
	   procps-ng \
	   scapy \
	   net-tools \
	   lsof \		
	   lighttpd
RUN setcap cap_net_raw,cap_net_admin+p /usr/bin/ping
#EXPOSE 80
#EXPOSE 5001
CMD ["/bin/bash"]

Be sure to always include packages provinding bash and ip commands, because ovs-toolbox is going to use them to configure networking inside container !

  • h You can also import some already made dockerfile from your dockerfile library.
  • m Press button to create image.
  • n Note that you can save your dockerfile to your dockerfile library in order to reuse it later.

diag

A popup will appear to inform you about the docker image log file path. Validate to acknowledge. As image creation can take a long time, it can be a good idea to watch these logs carefully. ( Suggestion: go into a terminal and tail -f the given log file path)

diag

  • p Refresh Docker image list ( several times if needed )
  • q After a while you should see your freshly built docker image.
Clone this wiki locally