Dockerfile

You create a Dockerfile to create an image for your own container. You can specify the base image for your container, commands to execute when setting up the container, ports to expose, files to copy to the container, and the entry point (the program to run when the container starts). Here are some of the frequently used instructions in a Dockerfile:

  • FROM: Specify the base image for your Docker container, for example, FROM Ubuntu.
  • ADD: Add file(s) from the host machine to the Docker container. For example, to copy the setup.sh file from the directory from where Docker commands are run to a container. For example, ADD ./setup.sh /setup.sh.
  • RUN: Runs a command in the container. For example, to make the setup.sh file executable after ...

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.