无法在circleci作业中使用docker

无法在circleci作业中使用docker,docker,circleci,Docker,Circleci,这是我的circleci配置文件 version: 2 jobs: build: docker: - image: 12345678.dkr.ecr.us-west-1.amazonaws.com/circleci/build:20180319 steps: - checkout - run: name: Install docker command: | apt-get u

这是我的circleci配置文件

version: 2
jobs:
  build: 
    docker:
      - image: 12345678.dkr.ecr.us-west-1.amazonaws.com/circleci/build:20180319
    steps:
      - checkout
      - run:
          name: Install docker
          command: |
            apt-get update --fix-missing
            apt-get install -y apt-transport-https ca-certificates software-properties-common
            curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
            apt-key fingerprint 0EBFCD88
            add-apt-repository \
              "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
              $(lsb_release -cs) \
              stable"
            apt-get update
            apt-get install -y docker-ce
            docker --version
      - run:
          name: Build and deploy docker images
          command: |
            docker build -t myapp .
“安装Docker”基本上是按照以下说明建模的:

当作业执行到行
docker build
时,我得到以下错误:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
 /etc/init.d/docker: 96: ulimit: error setting limit (Operation not permitted)
因此,我尝试在构建任务之前启动docker服务。但现在我得到了这个错误:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
 /etc/init.d/docker: 96: ulimit: error setting limit (Operation not permitted)
这是由于码头工人的限制。它不允许
ulimit-u


如何绕过此限制并启动docker守护进程?

在使用docker之前添加一个步骤
设置\u remote\u docker
。i、 e

  - setup_remote_docker
  - run:
      name: Build and deploy docker images
      command: |
        docker build -t myapp .

在使用docker之前添加一个步骤
setup\u remote\u docker
。i、 e

  - setup_remote_docker
  - run:
      name: Build and deploy docker images
      command: |
        docker build -t myapp .