发布日期:2019-06-03 17:42:12

1. 这个Docker视频demo了一个Docker的应用场景: https://www.youtube.com/watch?v=YFl2mCHdv24

2. <<Kubernetes for Beginners - Docker Introduction>> 这个视频非错不错的解释了Docker解决的痛点以及其架构。 https://www.youtube.com/watch?v=rmf04ylI2K0

3. 《Introduction to Kubernetes》介绍一些概念并demo了安装和使用kubernetes。https://www.youtube.com/watch?v=DiWzujzol70

4. 官方文档: https://docs.docker.com/

5. 中文文档: https://yeasy.gitbooks.io/docker_practice/introduction/

 

Docker简介

Docker分为CE社区版和EE企业版两大版本。

为什么要用Docker:

Why Docker?
Faster delivery of your applications

We want your environment to work better. Docker containers, and the work flow that comes with them, help your developers, sysadmins, QA folks, and release engineers work together to get your code into production and make it useful. We’ve created a standard container format that lets developers care about their applications inside containers while sysadmins and operators can work on running the container in your deployment. This separation of duties streamlines and simplifies the management and deployment of code.

We make it easy to build new containers, enable rapid iteration of your applications, and increase the visibility of changes. This helps everyone in your organization understand how an application works and how it is built.

Docker containers are lightweight and fast! Containers have sub-second launch times, reducing the cycle time of development, testing, and deployment.

Deploy and scale more easily

Docker containers run (almost) everywhere. You can deploy containers on desktops, physical servers, virtual machines, into data centers, and up to public and private clouds.

Since Docker runs on so many platforms, it’s easy to move your applications around. You can easily move an application from a testing environment into the cloud and back whenever you need.

Docker’s lightweight containers also make scaling up and down fast and easy. You can quickly launch more containers when needed and then shut them down easily when they’re no longer needed.

Get higher density and run more workloads

Docker containers don’t need a hypervisor, so you can pack more of them onto your hosts. This means you get more value out of every server and can potentially reduce what you spend on equipment and licenses.

Faster deployment makes for easier management

As Docker speeds up your work flow, it gets easier to make lots of small changes instead of huge, big bang updates. Smaller changes mean reduced risk and more uptime.

Docker手动下载安装

下载 https://download.docker.com/

比如mac版: https://download.docker.com/mac/stable/Docker.dmg 

Docker for Mac requires OS X El Capitan 10.11 or newer macOS release running on a 2010 or newer Mac, with Intel’s hardware support for MMU virtualization. The app runs on 10.10.3 Yosemite, but with limited support. See What to know before you install for a full explanation and list of prerequisites.

 

删除VirtualBox

如果VirtialBox有冲突,那么可以删除VirtualBox. https://nektony.com/how-to/uninstall-virtualbox-on-mac

Go to Library folder and from there remove all files and folders related to the virtual machine.
~/Library/VirtualBox

~/Library/Preferences/org.VirtualBox.app.VirtualBox.plist

~/Library/Saved Application State/org.VirtualBox.app.VirtualBox.SavedState

~/Library/LaunchAgents/org.virtualbox.vboxwebsrv.plist

 

安装时可能遇到的问题 (Docker CE Version 18.03.1-ce-mac65 (24312) and Mac OS 10.11.6)

Cannot create/resize "Library/Containers/com.docker.docker/Data/vms/0/Docker.qcow2": exit status 1

这个文件是mac版本的 docker存放image的地方。pull的image都存放在这里。不同于其他OS的docker。

解决方案:

第一部分,删除了一些文件后上面的问题没有了。

sudo rm -r /var/tmp/com.docker.vmnetd.socket  
sudo rm -r ~/Library/Application\ Scripts/com.docker.helper/  
sudo rm -r ~/Library/Containers/com.docker.*  
sudo rm -r ~/Library/Preferences/com.docker.docker.plist  
sudo rm -r ~/Library/Group\ Containers/group.com.docker/  

但是出现了新的问题,Fatal Error: Communication with networking components failed. 于是加了下面的解决方案。

Found fix:

sudo chown root:wheel /Applications/Docker.app/Contents/Resources/com.docker.vmnetd.plist

cd /Library/LaunchDaemons
ln -s /Applications/Docker.app/Contents/Resources/com.docker.vmnetd.plist

sudo launchctl load com.docker.vmnetd.plist

安装后

Docker Engine:

Develop, Ship and Run Any Application, Anywhere

Docker is a platform for developers and sysadmins to develop, ship, and run applications. Docker lets you quickly assemble applications from components and eliminates the friction that can come when shipping code. Docker lets you get your code tested and deployed into production as fast as possible.

Docker consists of:

The Docker Engine - our lightweight and powerful open source containerization technology combined with a work flow for building and containerizing your applications.
Docker Hub - our SaaS service for sharing and managing your application stacks.

Notary:

What is Notary
Notary is a tool for publishing and managing trusted collections of content. Publishers can digitally sign collections and consumers can verify integrity and origin of content. This ability is built on a straightforward key management and signing interface to create signed collections and configure trusted publishers.

With Notary anyone can provide trust over arbitrary collections of data. Using The Update Framework (TUF) as the underlying security framework, Notary takes care of the operations necessary to create, manage, and distribute the metadata necessary to ensure the integrity and freshness of your content.

Compose:

Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. To learn more about all the features of Compose, see the list of features.

Compose works in all environments: production, staging, development, testing, as well as CI workflows. You can learn more about each case in Common Use Cases.

Using Compose is basically a three-step process:

Define your app’s environment with a Dockerfile so it can be reproduced anywhere.

Define the services that make up your app in docker-compose.yml so they can be run together in an isolated environment.

Run docker-compose up and Compose starts and runs your entire app.

Machine:

You can use Docker Machine to:

Install and run Docker on Mac or Windows
Provision and manage multiple remote Docker hosts
Provision Swarm clusters
What is Docker Machine?
Docker Machine is a tool that lets you install Docker Engine on virtual hosts, and manage the hosts with docker-machine commands. You can use Machine to create Docker hosts on your local Mac or Windows box, on your company network, in your data center, or on cloud providers like Azure, AWS, or Digital Ocean.

Using docker-machine commands, you can start, inspect, stop, and restart a managed host, upgrade the Docker client and daemon, and configure a Docker client to talk to your host.

Point the Machine CLI at a running, managed host, and you can run docker commands directly on that host. For example, run docker-machine env default to point to a host called default, follow on-screen instructions to complete env setup, and run docker ps, docker run hello-world, and so forth.

Machine was the only way to run Docker on Mac or Windows previous to Docker v1.12. Starting with the beta program and Docker v1.12, Docker Desktop for Mac and Docker Desktop for Windows are available as native apps and the better choice for this use case on newer desktops and laptops. We encourage you to try out these new apps. The installers for Docker Desktop for Mac and Docker Desktop for Windows include Docker Machine, along with Docker Compose.

If you aren’t sure where to begin, see Get Started with Docker, which guides you through a brief end-to-end tutorial on Docker.

Credential Helper:

docker-credential-helpers is a suite of programs to use native stores to keep Docker credentials safe.

 

发表评论