Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
583 views
in Technique[技术] by (71.8m points)

docker - OCI runtime create failed container_linux.go:370

I searched this error and the solution given on threads is not working Cannot start any docker container with "oci runtime error"

So I am on MacOS and I have upgraded and restarted docker service multiple times.

Here is my Dockerfile

FROM openjdk:alpine
RUN apk add --no-cache wget su-exec bash
RUN wget -qO- https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/7.3.2/flyway-commandline-7.3.2-linux-x64.tar.gz | tar xvz && su-exec sh ln -s `pwd`/flyway-7.3.2/flyway /usr/local/bin
RUN ln -sf /usr/bin/java /flyway-7.3.2/jre/bin
RUN mv /flyway-7.3.2/conf/flyway.conf /flyway-7.3.2/conf/flyway.conf.orig
COPY ./flyway.conf /flyway-7.3.2/conf/flyway.conf
CMD [ "/flyway-7.3.2/flyway migrate" ]

And here is my service in docker-compose.yml

  flyway:
    build: flyway
    container_name: flyway
    volumes:
      - ./flyway/migrations:/migrations
    links:
      - db
    depends_on:
        db:
          condition: service_healthy

But when I say docker-compose up I get an error almost on all containers

Creating flyway ... error
ERROR: for flyway  Cannot start service flyway: OCI runtime create failed: container_linux.go:370: starting container process caused: exec: "/flyway-7.3.2/flyway migrate": stat /flyway-7.3.2/flyway migrate: no such file or directory: unknown
question from:https://stackoverflow.com/questions/65877107/oci-runtime-create-failed-container-linux-go370

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The OCI message is just part of how Alpine reports an error. But your actual error is in the CMD line.

Your syntax is not correct. Either you remove the [] or add as comma a @jakub pointed out.

https://docs.docker.com/engine/reference/builder/#cmd


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...