Python abs() Function

Python abs() Function

A built-in Python function that gets used a lot in computational work is the abs() function. The abs() function accepts a numeric value as input and returns the absolute value of that input. The absolute value refers to the non-negative value of a number. So for example the absolute value of -10 is 10. The absolute value of 10 is also 10. In this tutorial, we will look at examples of how to use the abs() function in some small Python programs.…

Python input() Function

Python Input Function

The input() function in Python makes it very easy to get input from users of your application. The input function is built in just like the print function and its use is quite common. When you call the input function(), you can think of it as an expression that evaluates to whatever the user typed in at the prompt. This always gets returned as a string so if you want to use numbers as input, you will need to handle that by using the int() function.…

Python print() Function

Python print function

There are several key functions in the Python programming language that are super useful. The Python print function is definitely one of the first ones that you should know. The print function accepts data as an input and then displays that data to the screen for the user to view. The print() function will be used all the time since it allows you to output the contents of a variable to the screen, allowing you to understand how your program is processing data.…

Docker Compose Tutorial

docker-compose

At this point in our Docker Tutorial Series, we have learned how to get Docker installed, run some Nginx containers, tested out MongoDB in a container, spun up more than one container, learned about Docker networking, DNS, images, volumes, and much more. You may have noticed that when using the Docker command-line interface, the commands can be somewhat verbose and require a lot of memorization of what commands to run to accomplish all of the prior mentioned tasks.…

Docker Bind Mounts

Docker Bind Mounts

Let’s take a look at Bind Mounting in Docker and how persistent data works with those mounts. Bind Mounts are a little different than Docker Volumes, however the syntax to use them is quite similar. Bind Mounts are really cool since they allow local development with files on your host to update in real-time in a container. Technically, a Bind Mount is a mapping of the host files or directories into the container’s files or directories.…

What Is A Docker Volume

What Is A Docker Volume

Docker has a feature known as Volumes, that allow developers to persist data in use with containers. They are entirely managed by the Docker Engine making them seamless to the end-user. Docker volumes are a very important and useful concept and in this tutorial, we’ll learn all about Docker volumes, how to create volumes, how to list volumes, and how to delete volumes. We’ll also see how to share a volume among containers by spinning up several containers which all make use of the same volume for data sharing.…

How To Use A Dockerfile

How To Use A Dockerfile

In the earlier Docker articles, we were able to build images and get them running as containers manually. In this tutorial, we will explore how to take this a step further by building images with code. This is where the Dockerfile comes into play. Dockerfiles are small programs that describe how to assemble a Docker image. You can run these small programs using the docker build command.…

DNS Round Robin In Docker

DNS Round Robin In Docker

DNS Round Robin is the concept that you can have two different hosts with DNS Aliases that respond to the same DNS Name. Where might you find something like this? Consider a service like Instagram. They need more than one server to provide their service, yet users always go to the same Instagram.com domain to use the service. One name, many servers providing the service. In addition to load balancing and server scaling, DNS Round Robin is another technique big companies can use to ensure 24/7/365 uptime.…