docker入门

  • 什么是docker
    docker is the world’s leading software containerization platform
    开源在github上
    跨平台 支持 linux windows maxos

    1、集装箱
    2、标准化
    1.运输方式:超级码头
    2.存储方式:标准化
    3.API接口:
    3、隔离

  • 理解Docker
    解决什么问题:
    1.环境配置
    2.用户隔离,功能隔离
    3.快速扩展、弹性伸缩

  • 走进Docker
    build 镜像:集装箱
    ship 仓库:超级码头
    run 容器:运行程序的地方

    docker image:文件
    联合文件系统 Union FS
    docker container: 进程
    docker repository: hub.docker.com / c.163.com

    docker version:

Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:39 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     true

在这里插入图片描述

  • Hello World
Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

在这里插入图片描述

  • Nginx服务
    1、持久运行容器
    2、前台挂起&后台运行
    3、进入容器内部
docker exec -it 21 bash 对已运行的容器执行命令
-d 后台运行
-i 交互
-t 伪终端
网络:
	网络类型 net namespace 
		bridge 
		host 宿主机同步
		none 不通讯
	端口映射

在这里插入图片描述

  • Docker化的Java web
    制作自己的镜像:
    Dockerfile:
    docker build:
    开源应用:Jpress:http://jpress.io/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值