K8S系列文章之 [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

相关推荐
lichenyang4531 天前
Docker 学习笔记(五):Docker Compose,用一个 YAML 启动前端、后端和 MongoDB
docker
lichenyang4531 天前
Docker 学习笔记(四):Dockerfile,把项目打成自己的镜像
docker·容器
lichenyang4531 天前
Docker 学习笔记(三):Docker 网络、bridge、子网和容器互通
docker·容器
lichenyang4531 天前
Docker 学习笔记(二):docker run 的参数到底在控制什么?
docker·容器
运维开发故事4 天前
基于 Arthas 的多集群在线诊断系统设计与实现
kubernetes
Patrick_Wilson6 天前
从「改个端口」到 502:Next.js on k8s 的容器端口、Service 映射与 env 覆盖
docker·kubernetes·next.js
探索云原生6 天前
K8s 1.36 这个 GA 特性,把 initContainer 拉模型的 hack 干掉了
ai·云原生·kubernetes
Suroy6 天前
DockerView-Go:用 Go 写一个终端 Docker 监控工具,顺便做了个 Web 仪表盘
docker
云恒要逆袭6 天前
运行你的第一个Docker容器
后端·docker·容器