skip to Main Content

Client Error: Bad Request ("b’OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "/usr/lib/jvm/java-8-openjdk-amd64/bin/java": stat /usr/lib/jvm/java-8-openjdk-amd64/bin/java: no such file or directory: unknown’")

this my error ,I cann’t fix this ,when I use docker-compose and docker
my version

Client: Docker Engine - Community
 Version:           19.03.12
 API version:       1.40
 Go version:        go1.13.10
 Git commit:        48a66213fe
 Built:             Mon Jun 22 15:45:44 2020
 OS/Arch:           linux/amd64
 Experimental:      false
Server: Docker Engine - Community
 Engine:
  Version:          19.03.12
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.13.10
  Git commit:       48a66213fe
  Built:            Mon Jun 22 15:44:15 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

docker compose version
docker-compose version 1.25.0, build unknown
docker-py version: 4.1.0
CPython version: 3.8.10
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020

Dockerfile

FROM openjdk:8-jdk

# Install maven
RUN apt-get update
RUN apt-get install -y maven

WORKDIR /code

# Prepare by downloading dependencies
ADD pom.xml /code/pom.xml
RUN ["mvn", "dependency:resolve", "-U"]
RUN ["mvn", "verify"]

# Adding source, compile and package into a fat jar
ADD src /code/src
RUN ["mvn", "package", "-DskipTest=True", "-Dmaven.javadoc.skip=true", "-Dmaven.test.skip=true", "--offline"]

EXPOSE 4458
# CMD ["ls", "-la", "target/"]
ENTRYPOINT ["/usr/lib/jvm/java-8-openjdk-amd64/bin/java", "-jar", "target/pbft-jar-with-dependencies.jar"]

docker-compose.yml


version: '2'
services:
  node_java:
    extends:
      file: docker-compose.node-java.yml
      service: node
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      NODE_DEBUG: "False"

docker-compose.node-java.yml

version: '2'
services:
  node:
    build: .
    environment:
      NODE_PORT: 4458
    command: ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"]
    # restart: "unless-stopped"
    # stdin_open: true
  node-pi:
    build:
      context: .
      dockerfile: ARM.Dockerfile
    environment:
      NODE_PORT: 4458

Any suggestion will help !!!

thank you very much

2

Answers


  1. Chosen as BEST ANSWER

    modify Old java site

    to this

    /usr/local/openjdk-8/bin/java
    

    it is error

    second I fix this using old version docker and docker-compose

    modify version :

    Since my project is 2017, I choose the old version of docker and the docker compose version close to 2017


    detail version

     docker-ce | 5:18.09.0~3-0~ubuntu-bionic | https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
    

    docker compose

    https://github.com/docker/compose/releases/tag/1.16.1

    1.16.1


  2. I think the path to the java executable in the image is different than the one you used.
    Can you try and replace the path in your DOCKERFILE like so?

    ENTRYPOINT ["/usr/local/openjdk-8/bin/java", "-jar", "target/pbft-jar-with-dependencies.jar"]
    

    I used the following procedure to find that out:

    docker pull openjdk:8-jdk
    docker run openjdk:8-jdk
    docker container ls -a
    
    mkdir -p /tmp/snapshot
    cd /tmp/snapshot
    docker export 7778d9fa6ce9> snapshot.tar
    tar -xvf snapshot.tar
    find . -type f -name java
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search