在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例一般编程问题 → docker学习_Learning Docker

docker学习_Learning Docker

一般编程问题

下载此实例
  • 开发语言:Others
  • 实例大小:1.35M
  • 下载次数:7
  • 浏览次数:99
  • 发布时间:2022-06-18
  • 实例类别:一般编程问题
  • 发 布 人:realfernando9
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: docker Dock doc ck OC

实例介绍

【实例简介】docker学习_Learning Docker

【实例截图】

【核心代码】

Table of Contents
About 1 1
Chapter 1: Getting started with Docker 2 2
Remarks 2
Versions 2
Examples 2
Installing Docker on Mac OS X 3
Installing Docker on Windows 4
Installing docker on Ubuntu Linux 5
Installing Docker on Ubuntu 9
Create a docker container in Google Cloud 11
Install Docker on Ubuntu 12
Installating Docker-ce OR Docker-ee on CentOS 16
Docker-ce Installation 16
-Docker-ee (Enterprise Edition) Installation 17
Chapter 2: Building images 19
Parameters 19
Examples 19
Building an image from a Dockerfile 19
A simple Dockerfile 20
Difference between ENTRYPOINT and CMD 20
Exposing a Port in the Dockerfile 21
Example: 21
ENTRYPOINT and CMD seen as verb and parameter 22
Pushing and Pulling an Image to Docker Hub or another Registry 22
Building using a proxy 23
Chapter 3: Checkpoint and Restore Containers 24
Examples 24
Compile docker with checkpoint and restore enabled (ubuntu) 24
Checkpoint and Restore a Container 25
Chapter 4: Concept of Docker Volumes 27
Remarks 27
Examples 27
A) Launch a container with a volume 27
B) Now press [cont P Q] to move out from container without terminating the container chec 27
C) Run 'docker inspect' to check out more info about the volume 27
D) You can attach a running containers volume to another containers 27
E) You can also mount you base directory inside container 28
Chapter 5: Connecting Containers 29
Parameters 29
Remarks 29
Examples 29
Docker network 29
Docker-compose 29
Container Linking 30
Chapter 6: Creating a service with persistence 31
Syntax 31
Parameters 31
Remarks 31
Examples 31
Persistence with named volumes 31
Backup a named volume content 32
Chapter 7: Data Volumes and Data Containers 33
Examples 33
Data-Only Containers 33
Creating a data volume 33
Chapter 8: Debugging a container 35
Syntax 35
Examples 35
Entering in a running container 35
Monitoring resource usage 35
Monitoring processes in a container 36
Attach to a running container 36
Printing the logs 37
Docker container process debugging 38
Chapter 9: Docker Data Volumes 39
Introduction 39
Syntax 39
Examples 39
Mounting a directory from the local host into a container 39
Creating a named volume 39
Chapter 10: Docker Engine API 41
Introduction 41
Examples 41
Enable Remote access to Docker API on Linux 41
Enable Remote access to Docker API on Linux running systemd 41
Enable Remote Access with TLS on Systemd 42
Image pulling with progress bars, written in Go 42
Making a cURL request with passing some complex structure 45
Chapter 11: Docker events 46
Examples 46
Launch a container and be notified of related events 46
Chapter 12: Docker in Docker 47
Examples 47
Jenkins CI Container using Docker 47
Chapter 13: docker inspect getting various fields for key:value and elements of list 48
Examples 48
various docker inspect examples 48
Chapter 14: Docker Machine 51
Introduction 51
Remarks 51
Examples 51
Get current Docker Machine environment info 51
SSH into a docker machine 51
Create a Docker machine 51
List docker machines 52
Upgrade a Docker Machine 53
Get the IP address of a docker machine 53
Chapter 15: Docker --net modes (bridge, hots, mapped container and none). 54
Introduction 54
Examples 54
Bridge Mode, Host Mode and Mapped Container Mode 54
Chapter 16: Docker network 56
Examples 56
How to find the Container's host ip 56
Creating a Docker network 56
Listing Networks 56
Add container to network 56
Detach container from network 57
Remove a Docker network 57
Inspect a Docker network 57
Chapter 17: Docker private/secure registry with API v2 59
Introduction 59
Parameters 59
Remarks 60
Examples 60
Generating certificates 60
Run the registry with self-signed certificate 60
Pull or push from a docker client 61
Chapter 18: Docker Registry 62
Examples 62
Running the registry 62
Configure the registry with AWS S3 storage backend 62
Chapter 19: Docker stats all running containers 63
Examples 63
Docker stats all running containers 63
Chapter 20: Docker swarm mode 64
Introduction 64
Syntax 64
Remarks 64
Swarm Mode CLI Commands 64
Examples 65
Create a swarm on Linux using docker-machine and VirtualBox 65
Find out worker and manager join token 66
Hello world application 66
Node Availablility 68
Promote or Demote Swarm Nodes 68
Leaving the Swarm 68
Chapter 21: Dockerfile contents ordering 70
Remarks 70
Examples 70
Simple Dockerfile 70
Chapter 22: Dockerfiles 72
Introduction 72
Remarks 72
Examples 72
HelloWorld Dockerfile 72
Copying files 73
Exposing a port 73
Dockerfiles best pratices 73
USER Instruction 74
WORKDIR Instruction 74
VOLUME Instruction 75
COPY Instruction 75
The ENV and ARG Instruction 76
ENV 76
ARG 77
EXPOSE Instruction 77
LABEL Instruction 78
CMD Instruction 79
MAINTAINER Instruction 80
FROM Instruction 80
RUN Instruction 81
ONBUILD Instruction 82
STOPSIGNAL Instruction 83
HEALTHCHECK Instruction 83
SHELL Instruction 84
Installing Debian/Ubuntu packages 86
Chapter 23: How to debug when docker build fails 88
Introduction 88
Examples 88
basic example 88
Chapter 24: How to Setup Three Node Mongo Replica using Docker Image and Provisioned using
89
Introduction 89
Examples 89
Build Step 89
Chapter 25: Inspecting a running container 93
Syntax 93
Examples 93
Get container information 93
Get specific information from a container 93
Inspect an image 95
Printing specific informations 96
Debugging the container logs using docker inspect 97
Examining stdout/stderr of a running container 97
Chapter 26: Iptables with Docker 98
Introduction 98
Syntax 98
Parameters 98
Remarks 98
The problem 98
The solution 99
Examples 100
Limit access on Docker containers to a set of IPs 100
Configure restriction access when Docker daemon starts 101
Some custom iptables rules 101
Chapter 27: Logging 102
Examples 102
Configuring a log driver in systemd service 102
Overview 102
Chapter 28: Managing containers 103
Syntax 103
Remarks 103
Examples 103
Listing containers 103
Referencing containers 104
Starting and stopping containers 104
List containers with custom format 105
Finding a specific container 105
Find container IP 105
Restarting docker container 105
Remove, delete and cleanup containers 105
Run command on an already existing docker container 106
Container logs 107
Connect to an instance running as daemon 107
Copying file from/to containers 107
Remove, delete and cleanup docker volumes 108
Export and import Docker container filesystems 108
Chapter 29: Managing images 110
Syntax 110
Examples 110
Fetching an image from Docker Hub 110
Listing locally downloaded images 110
Referencing images 110
Removing Images 111
Search the Docker Hub for images 112
Inspecting images 112
Tagging images 113
Saving and loading Docker images 113
Chapter 30: Multiple processes in one container instance 114
Remarks 114
Examples 114
Dockerfile supervisord.conf 114
Chapter 31: passing secret data to a running container 116
Examples 116
ways to pass secrets in a container 116
Chapter 32: Restricting container network access 117
Remarks 117
Examples 117
Block access to LAN and out 117
Block access to other containers 117
Block access from containers to the local host running docker daemon 117
Block access from containers to the local host running docker daemon (custom network) 118
Chapter 33: run consul in docker 1.12 swarm 119
Examples 119
Run consul in a docker 1.12 swarm 119
Chapter 34: Running containers 120
Syntax 120
Examples 120
Running a container 120
Running a different command in the container 120
Automatically delete a container after running it 120
Specifying a name 121
Binding a container port to the host 121
Container restart policy (starting a container at boot) 121
Run a container in background 122
Assign a volume to a container 122
Setting environment variables 123
Specifying a hostname 124
Run a container interactively 124
Running container with memory/swap limits 124
Getting a shell into a running (detached) container 124
Log into a running container 124
Log into a running container with a specific user 124
Log into a running container as root 125
Log into a image 125
Log into a intermediate image (debug) 125
Passing stdin to the container 126
Detaching from a container 126
Overriding image entrypoint directive 126
Add host entry to container 126
Prevent container from stopping when no commands are running 127
Stopping a container 127
Execute another command on a running container 127
Running GUI apps in a Linux container 127
Chapter 35: Running services 130
Examples 130
Creating a more advanced service 130
Creating a simple service 130
Removing a service 130
Scaling a service 130
Chapter 36: Running Simple Node.js Application 131
Examples 131
Running a Basic Node.js application inside a Container 131
Build your image 132
Running the image 133
Chapter 37: security 135
Introduction 135
Examples 135
How to find from which image our image comes from 135
Credits 136

标签: docker Dock doc ck OC

实例下载地址

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警