比特币开采
分类:电脑系统

官网配置步骤:

安装Docker环境

什么是Docker?

Docker 属于 Linux 容器的一种封装,提供简单易用的容器使用接口。它是目前最流行的 Linux 容器解决方案。
Docker 将应用程序与该程序的依赖,打包在一个文件里面。运行这个文件,就会生成一个虚拟容器。程序在这个虚拟容器里运行,就好像在真实的物理机上运行一样。有了 Docker,就不用担心环境问题。

总体来说,Docker 的接口相当简单,用户可以方便地创建和使用容器,把自己的应用放入容器。容器还可以进行版本管理、复制、分享、修改,就像管理普通的代码一样。
Docker 的主要用途,目前有三大类。

(1)提供一次性的环境。比如,本地测试他人的软件、持续集成的时候提供单元测试和构建的环境。

(2)提供弹性的云服务。因为 Docker 容器可以随开随关,很适合动态扩容和缩容。

(3)组建微服务架构。通过多个容器,一台机器可以跑多个服务,因此在本机就可以模拟出微服务架构。

安装Docker
本文以ubuntu系统为例

安装Docker社区版仓库

  1. Update the apt package index:

    $ sudo apt-get update
    
  2. Install packages to allow apt威尼斯手机娱乐官网 , to use a repository over HTTPS:

    $ sudo apt-get install 
        apt-transport-https 
        ca-certificates 
        curl 
        software-properties-common
    
  3. Add Docker’s official GPG key:

    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
  4. Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. To add the edge or test repository, add the word edge or test (or both) after the word stable in the commands below.

    $ sudo add-apt-repository 
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
       $(lsb_release -cs) 
       stable"
    

Install using the repository

Before you install Docker CE for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.

安装Docker社区版

  1. Update the apt package index.

    $ sudo apt-get update
    
  2. Install the latest version of Docker CE, or go to the next step to install a specific version:

    $ sudo apt-get install docker-ce
    

   3.Verify that Docker CE is installed correctly by running the hello-world image.

    $ sudo docker run hello-world

Set up the repository

  1. Update the apt package index:

    $ sudo apt-get update
    
  2. Install packages to allow apt to use a repository over HTTPS:

    $ sudo apt-get install 
        apt-transport-https 
        ca-certificates 
        curl 
        software-properties-common
    
  3. Add Docker’s official GPG key:

    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    

    Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

    $ sudo apt-key fingerprint 0EBFCD88
    
    pub   4096R/0EBFCD88 2017-02-22
          Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
    uid                  Docker Release (CE deb) <docker@docker.com>
    sub   4096R/F273FCD8 2017-02-22
    
  4. Use the following command to set up the stable repository. You always need the stable repository, even if you want to install builds from the edge or test repositories as well. To add the edge or test repository, add the word edge or test (or both) after the word stable in the commands below.

    Note: The lsb_release -cs sub-command below returns the name of your Ubuntu distribution, such as xenial. Sometimes, in a distribution like Linux Mint, you might need to change $(lsb_release -cs) to your parent Ubuntu distribution. For example, if you are using Linux Mint Rafaela, you could use trusty.

    • x86_64 / amd64
    • armhf
    • IBM Power (ppc64le)
    • IBM Z (s390x)
    $ sudo add-apt-repository 
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
       $(lsb_release -cs) 
       stable"
    

    Note: Starting with Docker 17.06, stable releases are also pushed to the edge and test repositories.

    Learn about stable and edge channels.

截图如下

   威尼斯手机娱乐官网 1

 

 

Install Docker CE

  1. Update the apt package index.

    $ sudo apt-get update
    
  2. Install the latest version of Docker CE, or go to the next step to install a specific version:

    $ sudo apt-get install docker-ce
    

    Got multiple Docker repositories?

    If you have multiple Docker repositories enabled, installing or updating without specifying a version in the apt-get install or apt-get update command always installs the highest possible version, which may not be appropriate for your stability needs.

  3. To install a specific version of Docker CE, list the available versions in the repo, then select and install:

    a. List the versions available in your repo:

    $ apt-cache madison docker-ce
    
    docker-ce | 18.03.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages
    

    b. Install a specific version by its fully qualified package name, which is the package name (docker-ce) plus the version string (2nd column) up to the first hyphen, separated by a an equals sign (=), for example, docker-ce=18.03.0.ce.

    $ sudo apt-get install docker-ce=<VERSION>
    

    The Docker daemon starts automatically.

  4. Verify that Docker CE is installed correctly by running the hello-world image.

    $ sudo docker run hello-world
    

windows系统和Mac系统下载安装包点击安装就可以了。

image文件

Docker 把应用程序及其依赖,打包在 image 文件里面。只有通过这个文件,才能生成 Docker 容器。image 文件可以看作是容器的模板。Docker 根据 image 文件生成容器的实例。同一个 image 文件,可以生成多个同时运行的容器实例。

image 是二进制文件。实际开发中,一个 image 文件往往通过继承另一个 image 文件,加上一些个性化设置而生成。举例来说,你可以在 Ubuntu 的 image 基础上,往里面加入 Apache 服务器,形成你的 image。

# 列出本机的所有 image 文件。
$ docker image ls

# 删除 image 文件
$ docker image rm [imageName]

获取iamge

docker image pull library/hello-world

查看本机的image

docker image ls

运行image

docker container run hello-world

容器文件

image 文件生成的容器实例,本身也是一个文件,称为容器文件。

列出本机正在运行的容器

docker container ls

列出本机所有容器,包括终止运行的容器

docker container ls --all

移除容器

docker container rm [containerID]

安装比特币测试网络

下载比特币测试网络镜像

sudo docker pull freewill/bitcoin-testnet-box

本文由威尼斯手机娱乐官网发布于电脑系统,转载请注明出处:比特币开采

上一篇:没有了 下一篇:没有了
猜你喜欢
热门排行
精彩图文