The way you build a container is through something called a Dockerfile. A Dockerfile is basically a set of instructions on how to build your container image; a typical Dockerfile is as follows:
FROM ubuntu:latest
LABEL maintainer="WebAdmin@company.com"
RUN apt update
RUN apt install -y apache2
RUN mkdir /var/log/my_site
ENV APACHE_LOG_DIR /var/log/my_site
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
COPY /my_site/ /var/www/html/
EXPOSE 80
CMD ["/usr/sbin/apache2","-D","FOREGROUND"]
As you can see, it is a very readable set of instructions. Without even knowing what each instruction does, we can assume its function because it's very similar to English. This Dockerfile is just an example and by far the most efficient way to do it.
An image is essentially like a template...