At Edgegap, we are working with containers to distribute the load evenly across the globe. We need to have your game started up within milliseconds; the containers need to be built with speed in mind. We will walk you through the creation of a docker image, also known as a container.
If you wish to have more information on the history of containers, Math our CEO wrote an excellent article on our blog
What is Docker?
- Docker is a PaaS (Platform as a Service) that allows OS-level virtualization.
What is the Docker Run command?
- Docker run command allows a container to be created from an image so that the Docker desktop engine can run the Container.
Let's start by adding the tools that you will need on your computer to create your first Container
You can follow the installation procedure as stated on Docker desktop.
Now that you have your local machine running Docker, we can start by doing a simple hello world
You can go to your command prompt and type the command above.
The steps will proceed automatically.
- Download the Container from the Edgegap Repository (Only the first time)
- Start the Container
- The name will be speedtest (--name)
- To expose your Container, you need to do it in the docker run command In this example, we will expose port 80 on the outside pointing to the expose 80 in the Container (-p)
- You can try it by going on your Web browser and hit http://localhost
- Voila, you have run your first Container.
Now that you have your Container running, you can interact with it, in the next session, we will restart the Container stop the Container and see the network is connected to, first of all, you will need to see what is running on your docker-engine locally at the command line type.
You should see something similar too.
You visually see the Container information running on your computer; you can have more than one running on this list.
This is a simple command; you will learn to use it a lot.
Let's say that you need to have more information about your running container. you can ask the docker engine to give you all the details about your Container by running the following command:
If you wish to see the internal network that was created by the docker engine, you can do so by running the following command.
You will get something similar to this:
If you wish to dig deeper into the network configuration, you can do so by running the following command
Now that you start your container you can stop it using