Docker build command Docker build command is used to build an image from a Dockerfile. For more details visit our Dockerfile and Dockerfile directives tutorial. Syntax docker build [OPTIONS] [Dockerfile PATH|URL] Example Let’s create an example Dockerfile in your current directory. vim Dockerfile and add the following content.
1 2 3 4 5 6 7 8 9 | FROM tecadmin/ubuntu-ssh:16.04 RUN apt-get update \ && apt-get install -y apache2 WORKDIR /var/www/html CMD ["apachectl", "-D", "FOREGROUND"] EXPOSE 80 |
Now build the image using single dot “.”, as Dockerfile is available in the current directory. Also, use -t image_name to specify tag name to the image. docker build -t apache_ubuntu . The build command will pull the image “tecadmin/ubuntu-ssh:16.04” from…
Read More