• 我只想在Windows Server 2019上build 基于Linux的Docker


    周末回家忘了带笔记本电源,电源耗尽,只能在家里的Windows Server 2019上继续工作,而当我在Windows Server 2019中用Docker Build我的Docker镜像的时候,出现如下错误:

    Using default tag: latest
    latest: Pulling from library/node
    no matching manifest for unknown in the manifest list entries

    我才意识到Windows Server 2019上安装的Docker是Windows容器的:

    PS C:UsersAdministrator> docker version
    Client: Docker Engine - Enterprise
     Version:           18.09.4
     API version:       1.39
     Go version:        go1.10.8
     Git commit:        c3516c43ef
     Built:             03/27/2019 18:22:15
     OS/Arch:           windows/amd64
     Experimental:      false
    
    Server: Docker Engine - Enterprise
     Engine:
      Version:          18.09.4
      API version:      1.39 (minimum version 1.24)
      Go version:       go1.10.8
      Git commit:       c3516c43ef
      Built:            03/27/2019 18:20:29
      OS/Arch:          windows/amd64
      Experimental:     false

    我第一个想到要在Windows Server 2019构建基于Linux OS的Docker的方法就是安装WSL(Windows Subsystem for Linux), 然后在WSL中安装Docker。

    开始行动,参考这篇文章:https://docs.microsoft.com/en-us/windows/wsl/install-on-server

    首先,开启WSL:

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

    然后按照这篇文章下载自己喜欢的Linux 子系统:https://docs.microsoft.com/en-us/windows/wsl/install-manual

     我选择的是Ubuntu 18/04,下载后解压出来,然后运行:

    Rename-Item ./Ubuntu-1804.appx ./Ubuntu.zip
    Expand-Archive ./Ubuntu.zip ./Ubuntu

    解压出来:

    直接执行ubuntu1804.exe安装ubuntu子系统,安装后进入ubuntu执行初始化工作,然后准备在WSL中安装docker:

    sudo apt-get update
    sudo apt-get install docker-ce docker-ce-cli containerd.io
    sudo docker run 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/

    恭喜你安装成功

    期间遇到很多问题:解决方法当时没有记录下来,可以参考下面几篇文章:

    https://zhuanlan.zhihu.com/p/39187620

    但是还是有点问题,DNS问题,使用npm install的报错:

    npm ERR! code EAI_AGAIN
    npm ERR! errno EAI_AGAIN
    npm ERR! request to https://registry-node.aliyun.com/org/1502272316663857/registry/cmgp/@cmgp%2fcommon failed, reason: getaddrinfo EAI_AGAIN registry-node.aliyun.com registry-node.aliyun.com:443
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2020-01-04T04_22_31_732Z-debug.log
    The command '/bin/sh -c npm install' returned a non-zero code: 1

    目前还在寻找解决方案中

  • 相关阅读:
    js取当前时间的秒级时间戳
    微信自动聊天脚本
    小程序 缓存过期问题
    去掉表格默认样式
    css3 画心
    数据导入(二):MapReduce
    数据导入(一):Hive On HBase
    HBase参数优化
    Hadoop运维手记
    HBase优化相关
  • 原文地址:https://www.cnblogs.com/tubo/p/12180215.html
Copyright © 2020-2023  润新知