“ docker-compose up”错误:无法启动服务获取程序:OCI运行时创建失败:container_linux.go:344

时间:2019-11-17 11:01:43

标签: node.js docker docker-compose

我正在ubuntu服务器上运行docker。有一阵子一切正常,然后泊坞窗停了下来,当我再次尝试放置它时,出现了这个错误:

ERROR: Service 'back' failed to build: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/bin/sh\": stat /bin/sh: no such file or directory": unknown

这是我的docker-compose.yml

version: "2"
services:
  back:
    build: ./crypto_feed_back
    restart: always
    command: node server.js
    volumes:
      - .:/usr/app/
  front:
    build: ./crypto_feed_front
    restart: always
    command: npm start
    volumes:
      - .:/usr/app/
    depends_on:
      - back
  fetcher:
    build: ./crypto_feed_fetch
    restart: always
    command: /usr/sbin/crond -l 2 -f
    depends_on:
      - postgres
  postgres:
    image: postgres:12-alpine
    restart: always
    environment:
      POSTGRES_USER: crypto_feed
      POSTGRES_DB: crypto_feed
    volumes:
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
    ports:
      - "5432:5432"
  caddy:
    image: elswork/arm-caddy:1.0.0
    restart: always
    environment:
      ACME_AGREE: "true"
    volumes:
      - ./caddy/Caddyfile:/etc/Caddyfile
      - ./caddy/certs:/root/.caddy
    ports:
      - 80:80/tcp
      - 443:443/tcp
    depends_on:
      - front

然后返回Dockerfile:

FROM node:alpine

# Create app directory
WORKDIR /usr/src/app

# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./

RUN npm install --production

# If you are building your code for production
# RUN npm ci --only=production
COPY ./api/ ./api/
COPY ./server.js .

EXPOSE 3001

CMD npm start

如果有人对如何解决这个问题有一个想法,那就太好了!

0 个答案:

没有答案