
上QQ阅读APP看书,第一时间看更新
The base image
Let's start by identifying the base image we want to use and build our image from. Is there an official Java image available that is compatible with our requirements? Remember that our imaginary application is based on Java SE 6. If such a base image is available, then let's use that one. Otherwise, we want to start with a Linux distro such as Red Hat, Oracle, or Ubuntu. In the latter case, we will use the appropriate package manager of the distro (yum, apt, or another) to install the desired versions of Java and Maven. For this, we use the RUN keyword in the Dockerfile. Remember, RUN gives us the possibility to execute any valid Linux command in the image during the build process.