Alpine搭建docker环境

Alpine搭建docker环境

基础环境已经具备,进行应用的安装和配置。

  1. 安装 docker 服务

    # 安装 docker
    apk add docker
    
  2. 配置 docker 服务

    # 启动 docker
    service docker start
    # 开机启动
    rc-update add docker boot
    # 查看版本
    docker version
    


  • 报错处理

    service docker restart
     * WARNING: you are stopping a boot service
    sh: error setting limit: Operation not permitted
     * docker: unable to apply RC_ULIMIT settings
     * Stopping Docker Daemon ...                                                                                      [ ok ]
    sh: error setting limit: Operation not permitted
     * docker: unable to apply RC_ULIMIT settings
     * Starting Docker Daemon ...
    
    • 解决方案

      # 解决方案 https://github.com/moby/moby/issues/43370
      # 注释原有 rc_ulimit  /etc/init.d/docker
      rc_ulimit=""
      RC_ULIMIT=""
      if [ "$1" = "start" ]; then
          if [ $BASH ]; then
              rc_ulimit="${DOCKER_ULIMIT:--c unlimited -n 1048576 -u unlimited}"
          else
              ulimit -c unlimited
              ulimit -n 1048576
              ulimit -p unlimited
          fi
      fi
      

posted @ 2024-01-23 13:02  虫祇  阅读(56)  评论(0编辑  收藏  举报