docker-compose failed to solve: rpc error: code = Unknown desc

Issue

I have a problem. I want to build a docker-compose file from tfserving but unfortunately I got the following error failed to solve: rpc error: code = Unknown desc. What is the problem? I am using Windows.

CMD

docker compose up -d

Dockerfile

FROM tensorflow/serving
EXPOSE 8601

docker-compose.yml

version: '3'

services:
  tfserving:
    container_name: tfserving
    build: ..
    ports:
      - "8601:8601"
    volumes:
      - ./model.config:/models/model.config
      - ../model:/models/model
    environment:
      - TENSORFLOW_SERVING_REST_API_PORT=8061
      - TENSORFLOW_SERVING_MODEL_NAME=model

      - TENSORFLOW_MODEL_BASE_PATH=/models/model/
    entrypoint: [ "bash", "-c", "tensorflow_model_server --rest_api_port=8601  --allow_version_labels_for_unavailable_models --model_config_file=/models/model.config"]

Error

docker compose up -d
[+] Building 0.0s (2/2) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                0.0s 
 => => transferring dockerfile: 2B                                                                                                                                                  0.0s 
 => CANCELED [internal] load .dockerignore                                                                                                                                          0.0s 
 => => transferring context:                                                                                                                                                        0.0s 
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount057242145/Dockerfile: no such file or directory

Dicrectory

|- tfserving
|  |- docker-compose.yml
|  |- Dockerfile
|  |- model.config
|- model
|  |- 1
|  |  |- ...
|  |- 2
|  |  |- ...
|....

Solution

You have too many dots in your docker-compose’s build(context) line:

version: '3'

services:
  tfserving:
    container_name: tfserving
    build: .. <-- here, the correct one is the current folder .

Answered By – IamK

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published