I am using docker-compose to build the docker. The docker file is trying to copy the folder outside of the context as shown below
I have a docker folder inside that folder I have a docker file and docker-compose file. The content of the docker file is shown below
FROM openjdk:17
RUN set -x \
mkdir -p fetebird-product
WORKDIR /fetebird-product
# Copy the source jar file to the docker destination folder
COPY ../../build/libs/*.jar /fetebird-product/
ENTRYPOINT ["java", "-jar", "/fetebird-product-api-0.1.jar"]
Docker compose
version: "3.9"
services:
fetebird-product:
build:
context: .
dockerfile: openjdk.dockerfile
ports:
- "8081:8081"
depends_on:
- mongodb
mongodb:
image: mongo:5.0.5
ports:
- "27017:27017"
While running the command docker compose up
, getting the exception as
=> ERROR [4/4] COPY ../../build/libs/*.jar /fetebird-product/ 0.0s
------
> [4/4] COPY ../../build/libs/*.jar /fetebird-product/:
------
failed to solve: lstat /var/lib/docker/tmp/buildkit-mount850007301/build/libs: no such file or directory
I know this is the issue of path location, when I move the files outside the docker folder the COPY
command words.
Just not sure how to point to the correct location outside of the context.