- It's a good practice to wrap components definitions with parenthesis.
type Country = String | |
type Code = String | |
type Year = Int | |
type Value = Double | |
data Entry = Entry { country :: !Country | |
, code :: !Code | |
, year :: !Year | |
, value :: !Value | |
} deriving (Show) | |
type Trend = [Entry] |
{-| | |
Module : FastDegrade | |
Description : Creates an image with multiple squares of different colors. | |
Copyright : (c) Fabio Thomaz MOlinar, 2021 | |
Maintainer : fabiomolinar@gmail.com | |
Stability : experimental | |
Second attempt at trying to make a module that create an image with multiple | |
squares of different colors on it. The first attempt, the module 'Degrade' | |
had a __terrible__ performance. |
{-| | |
Module : Degrade | |
Description : Creates an image with multiple squares of different colors. | |
Copyright : (c) Fabio Thomaz MOlinar, 2021 | |
Maintainer : fabiomolinar@gmail.com | |
Stability : experimental | |
This was my first attempt at creating a module that would be able to create an | |
image with multiple squares of different colors. Although it works, the efficiency | |
is __TERRIBLE__. |
Environment: | |
Request Method: POST | |
Request URL: http://localhost:8000/en/cms_wizard/create/ | |
Django Version: 1.11.16 | |
Python Version: 2.7.15 | |
Installed Applications: | |
('djangocms_admin_style', |
Source:
- Learning Docker (Book)
- Authors: Jeeva S. Chelladhurai, Vinod Singh, Pethuru Raj
Useful commands include: docker network connect
, docker network create
, docker network disconnect
, docker network inspect
, docker network ls
, and docker network rm
.
Default networks include:
- bridge
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/ |
Source:
- Learning Docker (Chapter 3)
- Author: Jeeva S. Chelladhurai, Vinod Singh, Pethuru Raj
As we discussed in the previous chapter, we can craft an image manually by launching a container from a base image, install all the required applications, make the necessary configuration file changes, and then commit the container as an image. As a better alternative, we can resort to the automated approach of crafting the images using Dockerfile, which is a text-based build script that contains special instructions in a sequence for building the correct and relevant images from the base images. The sequential instructions inside Dockerfile can include selecting the base image, installing the required application, adding the configuration and the data files, and automatically running the services as well as exposing those services to the external world. Thus, the Dockerfile-based automated build system has simplified the image-building process remarkably. It also offers a great deal of
Source:
- Learning Docker (Book)
- Authors: Jeeva S. Chelladhurai, Vinod Singh, Pethuru Raj
The
docker run
subcommand takes an image as an input and launches it as a container. You have to pass the-t
and-i
flags to the docker run subcommand in order to make the container interactive. The-i
flag is the key driver, which makes the container interactive by grabbing the standard input (STDIN
) of the container. The-t
flag allocates a pseudo-TTY or a pseudo Terminal (Terminal emulator) and then assigns that to the container. In the following example, we are going to launch an interactive container using the ubuntu:16.04 image and /bin/bash as the command:
$ sudo docker run -i -t ubuntu:16.04 /bin/bash