Failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to read dockerfile:
I'm doing a personal full-stack project just for practice but I keep getting this error for the docker commands after I try to run these docker commands as I am trying to build some microservices in separate containers.
I run these commands:
docker volume create tren-data
docker compose build
and I get this error.
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-mount3296053497/Dockerfile.dev: no such file or directory
This is what I wrote for my docker.yaml file. I would like to know and understand where I am going wrong with this. I had already premade each of the microservices already with the django and I believe it's with how I am making my docker file.
volumes:
ghi:
external: true
tren-data:
external: true
services:
react:
image: node:lts-bullseye
command: /bin/bash run.sh
working_dir: /app
volumes:
- ./ghi:/app
ports:
- "3000:3000"
environment:
HOST_OS: ${OS}
NODE_ENV: development
HOST: "0.0.0.0"
NUTRITION_APP_API_KEY: ${NUTRITION_APP_API_KEY}
WORKOUT_APP_API_KEY: ${WORKOUT_APP_API_KEY}
REACT_APP_NUTRITION_HOST: http://localhost:8091
REACT_APP_WORKOUTS_HOST: http://localhost:8080
REACT_APP_ACCOUNTS_HOST: http://localhost:8090
REACT_APP_GYMS_HOST: http://localhost:8081
database:
build:
context: ./relational-data
dockerfile: ./Dockerfile.dev
volumes:
- tren-data:/var/lib/postgresql/data
environment:
- POSTGRES_MULTIPLE_DATABASES=accounts,gyms,nutrition,workouts
- POSTGRES_PASSWORD=test-databases
ports:
- 15432:5432
workouts-api:
build:
context: ./workouts/workouts_rest
dockerfile: ./Dockerfile.dev
ports:
- "8080:8000"
volumes:
- ./workouts/workout_rest:/app
depends_on:
- database
environment:
DATABASE_URL: postgresql://workouts:password@database:5432/workouts
WAIT_HOSTS: database:5432
WORKOUT_APP_API_KEY: ${WORKOUT_APP_API_KEY}
gyms-api:
build:
context: ./gyms/gyms_rest
dockerfile: ./Dockerfile.dev
ports:
- "8081:8000"
volumes:
- ./gyms/gyms_rest:/app
depends_on:
- database
environment:
DATABASE_URL: postgresql://gyms:password@database:5432/gyms
WAIT_HOSTS: database:5432
#APIKEY
accounts-api:
build:
context: ./accounts/accounts_rest
dockerfile: ./Dockerfile.dev
ports:
- "8090:8000"
volumes:
- ./accounts/accounts_rest:/app
depends_on:
- database
environment:
DATABASE_URL: postgresql://accounts:password@database:5432/accounts
WAIT_HOSTS: database:5432
#APIKEY
nutrition-api:
build:
context: ./nutrition/nutrition_rest
dockerfile: ./Dockerfile.dev
ports:
- "8091:8000"
volumes:
- ./nutrition/nutrition_rest:/app
depends_on:
- database
environment:
DATABASE_URL: postgresql://nutrition:password@database:5432/nutrition
WAIT_HOSTS: database:5432
NUTRITION_APP_API_KEY: ${NUTRITION_APP_API_KEY}
I tried referencing a previous project that I did, however I am still unsure on how to go fix this issue and would love some help and input so I can get the microservices to work. Thank you