What are the basic steps involved while using docker for application development?

0 votes
Can somebody briefly explain what are the steps involved if i have to use docker for developing an application?
Aug 26, 2019 in Docker by anonymous

1 answer to this question.

0 votes

All the steps below are based on the prerequisite that Docker is already installed on the machine:

a) Create Dockerfile:

The initial step is to create a Dockerfile file using a suitable base image along with all the required steps/commands, like setting environment variables, adding application jar, etc. This creates several layers on the existing base image.

b) Build image:

Once the Dockerfile is ready, we can either use docker command or via a Gradle task to generate a docker image. This image contains all the application dependencies required to run the application in a container.

docker build -t-test/security tool.

c) Run the image:

Once the docker image is built, we can create and start the container using command.

docker run --name rest_tool test/security tool.

d) Start Containers using Compose:

In case we have multiple containers constituting an application like database, messaging queue, etc.; then it is advisable to use docker-compose to run multiple containers simultaneously. It is also useful in the CI pipeline for running the application and performing tests.

docker-compose up

e) Test the Application:

After the containers are up and running, the application is ready for Integration or Acceptance tests to be performed. Ideally, it is integrated into the CI pipeline for determining if the new code changes are affecting the existing flows.

f) Push image:

Typically in a container-based development environment, the deliverable artifact is a docker image. This image needs to be published to an internal Registry like Artifactory so that it can be propagated to next levels like Continuous Delivery and Deployment pipelines.

docker push test/securityTool

g) Production orchestration:

Ideally, organizations need to use orchestration tools like Kubernetes to run the containers in a Pod to perform load balancing, service discovery, etc in a production environment. It also helps in providing scalability and high availability of the application.

answered Aug 26, 2019 by Sirajul
• 57,940 points

Related Questions In Docker

0 votes
1 answer
+1 vote
1 answer

What is the default amount of memory provided for Windows Docker containers?

Docker for Windows containers by default get: On ...READ MORE

answered Oct 25, 2018 in Docker by Sophie may
• 10,100 points
0 votes
1 answer
0 votes
1 answer

What are the pre-requisites to install docker?

Docker installation on Ubuntu requires the following: One ...READ MORE

answered Feb 21, 2019 in Docker by Sushith
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 57,640 points
0 votes
1 answer

What is the process for stopping and restarting a docker container?

If you want to stop a docker ...READ MORE

answered Jul 3, 2019 in Docker by Sirajul
• 57,940 points
0 votes
1 answer

What are the different volume mount types available in docker?

There are three mount types available in ...READ MORE

answered Jul 4, 2019 in Docker by Sirajul
• 57,940 points