Docker allows you to build, manage and deploy applications inside containers. It provides a packed environment and allows developers to make portable applications by containerizing them. You can easily build a flask application, manage it and make it portable all using a single technology, docker. You can use similar techniques to build and deploy other python frameworks as well.In this article, we will be discussing how to build a simple application using flask and convert that into a docker image by containerizing it. You can follow the steps mentioned below to do the same.StepsCreate a new project folder. Let’s name ... Read More
After you have installed docker on your linux machine, the next step is to create an image and run a container. You need to create a base image of an OS distribution and after that you can add and modify the base image by installing packages and dependencies and committing the changes to it.In this article, we will show you how to create an ubuntu base image and on top of that create intermediate image layers by adding packages in it and keep committing the changes. We will update the ubuntu base image, install 3 packages - vim editor, firefox ... Read More
When you are working on a large project on docker, you need to go through certain phases of the development cycle. Maintaining a different dockerfile for each cycle such as build, release, testing etc. eats up a lot of resources and is highly inefficient when it comes to productivity.In the later versions of docker, it allows us to use what is called multi-stage Dockerfile with the help of two particular commands - FROM and AS.We can use multiple FROM commands combined with AS commands in our Dockerfile where the last FROM command will actually build the image. All the FROM ... Read More
The commands RUN, CMD and Entrypoint usually cause a lot of confusion among docker developers. Understanding all the three commands conceptually will help to have a clearer understanding of the same.When we try to build an image using dockerfile, the instructions are executed step by step. The first instruction is usually pulling a base image such as an OS distribution like ubuntu, centos etc. After that, we modify the base image either by including more images using FROM and AS commands or by modifying the images. Every such instruction creates a new intermediate image build and for each of them, ... Read More
Suppose you are building an application that requires user interface and pops up a window on running the script. And let’s say you want to run that script inside a docker container. Now, you might expect the docker container to run the UI application for you and display the same on your screen. But using normal docker run commands, you won't be able to see or interact with the UI application. You need to connect the display with the container in order to do so. In this article, we will discuss how to do exactly the same.Here, we will see ... Read More
We know that we can run our docker images on cloud services which provide high computations in low cost prices. So, one might wonder why we need to optimize a docker image. Think of a situation where you have copied a large file in your docker container and you actually don’t need it. It’s obvious that it will increase the size of the docker image, it will increase the overall build time of the image and would cause a lot of caching issues as well. So, why not use a simple technique to avoid all these issues and improve the ... Read More
If you want to build a new container image, you need to specify the instructions in a separate document called Dockerfile. This will allow a developer to create an execution environment and will help him to automate the process and make it repeatable. It provides you with flexibility, readability, accountability and helps in easy versioning of the project.No doubt, writing a Dockerfile is one of the most important aspects of a project which includes development using docker. However, how you write a Dockerfile might have a great impact on the performance of your project if you are deploying it on ... Read More
It’s true that the use of docker has skyrocketed in recent times and it will continue to increase in the coming years. Most organizations are now shifting their projects to docker containers if they have not already. Thus, only acquiring basic knowledge regarding creating and maintaining docker containers and images is not enough to keep up with the pace of such a huge technological shift.Managing a large number of containers and images through a single command line interface (CLI) seems to be a tedious task, but with proper set of management skills and hands-on experience with docker CLI commands, this ... Read More
To populate select list with jQuery, use for loop along with append() and append the options to the already created select.Let’s say we have the following select with options − John David ExampleFollowing is the code to append more number of options using append() − Live Demo Document John David $(document).ready(function () { var data = [ { "name": "Bob", "customerName": "Bob" }, { "name": "Mike", "customerName": "Mike" } ]; for (var index = 0; index
To convert integer array to string array, use the map(String) in JavaScript. Let’s say the following is our integer array −var integerValues = [101, 50, 70, 90, 110, 90, 94, 68];Convert integer array to string array −integerValues.map(String);ExampleFollowing is the code −var integerValues = [101, 50, 70, 90, 110, 90, 94, 68]; console.log("The integer array value="); console.log(integerValues); integerValues.map(String); console.log("The string array value="); console.log(integerValues)To run the above program, you need to use the following command −node fileName.js.Here, my file name is demo212.js.OutputThe output is as follows in console −PS C:\Users\Amit\JavaScript-code> node demo212.js The integer array value= [ 101, 50, 70, 90, ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP