Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Installing and Using Docker on Ubuntu, Summaries of Computer Science

A step-by-step guide on installing and using docker on an ubuntu system. It covers the installation process, docker lifecycle management, and various docker commands and concepts such as docker login, running containers, exposing ports, and customizing docker images. The document also includes instructions for setting up a docker swarm cluster and using minikube to create a local kubernetes cluster. Additionally, it provides an overview of amazon elastic container service (ecs) and the process of creating and deploying docker images on ecs. This comprehensive guide is suitable for both beginner and intermediate-level users who want to learn about docker and its practical applications in a ubuntu environment.

Typology: Summaries

2023/2024

Uploaded on 12/17/2023

khushi-sharma-25
khushi-sharma-25 🇮🇳

1 document

1 / 98

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Name: Abhinav Kumar Roll No: R2142210024
Lab 1
Docker Installation on Windows
Prerequisites: WSL or Hyper-V Backend
WSL (Windows Subsystem for Linux):
WSL version 1.1.3.0 or later.
Windows 11 64-bit: Home or Pro version 21H2 or higher, or Enterprise or
Education version 21H2 or higher.
Windows 10 64-bit: Home or Pro 21H2 (build 19044) or higher, or Enterprise
or Education 21H2 (build 19044) or higher.
Hyper-V Backend and Windows Containers:
Windows 11 64-bit: Pro version 21H2 or higher, or Enterprise or Education
version 21H2 or higher.
Windows 10 64-bit: Pro 21H2 (build 19044) or higher, or Enterprise or
Education 21H2 (build 19044) or higher.
Hyper-V and Containers Windows features must be turned on.
The following hardware prerequisites are required to successfully run Client Hyper-V or WSL on
Windows 10:
64 bit processor with Second Level Address Translation (SLAT)open_in_new
4GB system RAM
BIOS-level hardware virtualization support must be turned on in the BIOS
settings. For more information, see Virtualization.
Instructor: Avita Katal
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62

Partial preview of the text

Download Installing and Using Docker on Ubuntu and more Summaries Computer Science in PDF only on Docsity!

Lab 1 Docker Installation on Windows Prerequisites: WSL or Hyper-V Backend WSL (Windows Subsystem for Linux): WSL version 1.1.3.0 or later. Windows 11 64-bit: Home or Pro version 21H2 or higher, or Enterprise or Education version 21H2 or higher. Windows 10 64-bit: Home or Pro 21H2 (build 19044) or higher, or Enterprise or Education 21H2 (build 19044) or higher. Hyper-V Backend and Windows Containers: Windows 11 64-bit: Pro version 21H2 or higher, or Enterprise or Education version 21H2 or higher. Windows 10 64-bit: Pro 21H2 (build 19044) or higher, or Enterprise or Education 21H2 (build 19044) or higher. Hyper-V and Containers Windows features must be turned on. The following hardware prerequisites are required to successfully run Client Hyper-V or WSL on Windows 10: 64 bit processor with Second Level Address Translation (SLAT)open_in_new 4GB system RAM BIOS-level hardware virtualization support must be turned on in the BIOS settings. For more information, see Virtualization.

Installing the Docker Desktop Step 1: Double-click Docker Desktop Installer.exe to run the installer. Step 2: When prompted, ensure the Use WSL 2 instead of Hyper-V option on the Configuration page is selected or not depending on your choice of backend. If your system only supports one of the two options, you will not be able to select which backend to use.

Step 4: When the installation is successful, select Close to complete the installation process.

Starting the Docker Desktop Step 5: Search for Docker, and select Docker Desktop in the search results. Step 6: The Docker menu ( whale menu ) displays the Docker Subscription Service Agreement. Here’s a summary of the key points: ● Docker Desktop is free for small businesses, personal use, education, and non-commercial open source projects. ● Otherwise, it requires a paid subscription for professional use.

Step 8: We are greeted with the homepage of the Docker Desktop.

Step 9: To confirm the installation of the Docker Engine, go the command line and type the following command: Docker version

docker ps: The docker ps command is used to list the currently running Docker containers on your system. It provides information about containers such as their names, IDs, status, and various other details. By default, docker ps only shows the running containers. docker ps [OPTIONS] ● OPTIONS: These are optional flags that you can use to customize the output and filter the list of containers. Some commonly used options include: -a or --all: Show all containers, including those that are not currently running. --quiet or -q: Only display container IDs. --filter: Filter containers based on various criteria such as status, label, network, etc. docker help: The docker help command is used to display the help documentation for various Docker commands. You can use it to get information about how to use specific Docker commands, their options, and usage examples.

docker help [COMMAND] ● COMMAND: This is an optional parameter that specifies the Docker command you want to get help for. If you provide a command name, the help documentation for that specific command will be displayed. If you don't provide a command name, you'll get a list of available Docker commands. docker stop: The docker stop command is used to stop one or more running Docker containers. When you stop a container, it goes from a running state to a stopped state, and its processes are gracefully terminated. docker stop [OPTIONS] CONTAINER [CONTAINER...]

docker pause: The docker pause command is used to temporarily pause all processes within one or more running Docker containers. When you pause a container, its processes are frozen, effectively putting the container in a suspended state. This can be useful when you need to temporarily halt the execution of processes in a container without stopping or terminating the container itself. docker pause CONTAINER [CONTAINER...] ● CONTAINER: This is the name or ID of the container you want to pause. You can specify one or more containers separated by spaces. docker unpause: When a container is paused, its processes are frozen in their current state. No new processes can be started within the container, and existing processes are halted until the container is unpaused. To resume the processes within a paused container, you can use the docker unpause command: docker unpause my_container ● CONTAINER: This is the name or ID of the container you want to pause. You can specify one or more containers separated by spaces. docker run: The docker run command is used to create and start a new Docker container from a specified image. This command is one of the fundamental commands in Docker, allowing you to instantiate isolated environments (containers) based on images that contain all the necessary software and dependencies to run an application.

docker run [OPTIONS] IMAGE [COMMAND] [ARG...] ● OPTIONS: These are optional flags that you can use to customize the behavior of the container being created, such as specifying ports, volumes, environment variables, networking, and more. ● IMAGE: This is the name or ID of the Docker image you want to use as the basis for the container. ● COMMAND: This is an optional command to be executed within the container. If no command is provided, the default command defined in the Docker image will be executed. ● ARG: These are optional arguments that can be passed to the command within the container. docker rm: The docker rm command is used to remove one or more Docker containers from your system. When you remove a container, it's permanently deleted, and any data or changes made within the container are lost. docker rm [OPTIONS] CONTAINER [CONTAINER...] ● OPTIONS: These are optional flags that you can use to customize the behavior of the container removal, such as forcefully removing a running container using the -f flag. ● CONTAINER: This is the name or ID of the container you want to remove. You can specify one or more containers separated by spaces.

OPTIONS: These are optional flags that you can use to filter and sort the search results. ● TERM: This is the keyword or term you want to search for in Docker Hub. You can use terms like software names, programming languages, tools, etc.

Lab 3 (Part 1) Apache Image Step 1: Check current images docker images Step 2: Search for apache images present on DockerHub docker search apache Step 3: Pull httpd server image docker pull httpd

Step 8: Go to the localhost:8080 to see the running container Step 9: Bash into the image using the command docker exec -it apacheee bash Step 10: Browse to the index.html file directory cd /usr/local/apache2/htdocs/ Step 11: Install the vim editor apt-get install install vim

Step 12: vi into the index.html file and change the content vi index.html