Docker Run Static Website

Deploy A Static Website with Docker The static websites are the HTML pages, directly severed by any web servers. It may also include some other static assets like css, js and images. In this tutorial you will learn, how to deploy a static website on Docker container. 1. Create A Static Website We assume you already have a static site on your system. For this tutorial, I have downloaded a static website from here. After making some changes, placed all files in a directory on Docker server. 2. Create Dockerfile…

Read More

Docker Java Example

Run Java Application with Docker Docker provides official images to run Java program on command line. You can run Java programs without installing Java on your system. This will be helpful to you choose any version of Java during program execution. This tutorial will help you to run a sample java program using Docker containers. Run Java Program with Docker The below steps will help you to create a sample Java program. then create a Dockerfile to run a Java program under the docker container. After that build a custom…

Read More

Docker PHP Example

Run PHP Web Application with Docker You can run any PHP application on using web server or command line using Docker containers. This tutorial will help you to run a PHP script over command line with a Docker container. Also, you will find the instructions to run a PHP script over Apache/Nginx web server with Docker. Docker PHP Example with Apache Create PHP Script – First, create a sample PHP script to run on web server under the Docker container. Edit index.php in your favorite text editor. nano index.php Add…

Read More

Docker – Dockerfile Directives

What are Dockerfile Directives In our previous tutorial, you learned how to build images with Dockerfile. This tutorial will help you to understand the basic Dockerfile directives and there uses. FROM The from directive is used to set base image for the subsequent instructions. A Dockerfile must have FROM directive with valid image name as the first instruction. Examples: FROM ubuntu FROM tecadmin/ubuntu-ssh:16.04 LABEL Using label you can organize images in a proper way. this is useful to set maintainer address, vender name, version of image, release date etc. The…

Read More

Docker – Dockerfile

Working with Dockerfile Dockerfile is a file used to build images by reading instructions from a file. The default name is used as Dockerfile. You can create dockerfile in the current directory with specific instructions and build a customized image as per your requirements. Build Image with Dockerfile As a best practice, the Dockerfile is called Dockerfile and located in the root of the context. You can use the following command to build docker image. This will read Dockerfile in the current directory. $ docker build -t image_name . You…

Read More