// Module included in the following assemblies:
//
// * architecture/understanding-development.adoc

:_mod-docs-content-type: REFERENCE
[id="building-simple-container_{context}"]
= Simple container build process

[role="_abstract"]
To containerize an application, you need a build tool, a file to define the image, and a container registry to store and distribute the application.

First, you need a tool for building a container, like buildah or docker.
You also need a file that describes what goes in your container, which is typically a Dockerfile.

Next, you need a location to push the resulting container image so you can
pull the image to run anywhere you want the image to run. 
This location is a container registry.

Some examples of each of these components are installed by default on most
Linux operating systems, except for the Dockerfile, which you provide yourself.

The following diagram displays the process of building and pushing an image:

.Create a simple containerized application and push it to a registry
image::create-push-app.png[Creating and pushing a containerized application]

If you use a computer that runs {op-system-base-full} as the operating
system, the process of creating a containerized application requires the
following steps:

. Install container build tools: {op-system-base} contains a set of tools that includes
podman, buildah, and skopeo that you use to build and manage containers.
. Create a Dockerfile to combine base image and software: Information about
building your container goes into a file that is named `Dockerfile`. In that
file, you identify the base image you build from, the software packages you
install, and the software you copy into the container. You also identify
parameter values like network ports that you expose outside the container and
volumes that you mount inside the container. Put your Dockerfile and the
software you want to containerize in a directory on your {op-system-base} system.
. Run buildah or docker build: Run the `buildah build-using-dockerfile` or
the `docker build` command to pull your chosen base image to the local system and
create a container image that is stored locally. You can also build container images
without a Dockerfile by using buildah.
. Tag and push to a registry: Add a tag to your new container image that
identifies the location of the registry in which you want to store and share
your container. Then push that image to the registry by running the
`podman push` or `docker push` command.
. Pull and run the image: From any system that has a container client tool,
such as podman or docker, run a command that identifies your new image.
For example, run the `podman run <image_name>` or `docker run <image_name>`
command. Here `<image_name>` is the name of your new container image, which
resembles `quay.io/myrepo/myapp:latest`. The registry might require credentials
to push and pull images.

ifdef::openshift-origin,openshift-enterprise[]
For more details on the process of building container images, pushing them to
registries, and running them, see "Custom image builds with Buildah".
endif::openshift-origin,openshift-enterprise[]
