docker / compose

Define and run multi-container applications with Docker
https://docs.docker.com/compose/
Apache License 2.0
34.01k stars 5.23k forks source link

[BUG] Failed to compute cache key: failed to calculate checksum of ref ... #12028

Closed GayeongKimm closed 3 months ago

GayeongKimm commented 3 months ago

Description

Hi, I have a problems flowing this: I'm working on a project that I'm doing at school, but it's so hard because I keep getting these errors. Deploying using github operation and docker, but >> COPY build/libs/sopo-2.0.0.jar/sopo.jar error appears here

스크린샷 2024-07-28 오후 8 05 18

It's called the path problem, and the Dockerfile is in the root path, and build/libs are in the root path. Jar files are also created, so why does this happen?

I'm still a high school student developer, so there's a lot I don't know, so please help me.

docker-compose.yml

version:  '3'

services:
  redis:
    image:  redis:alpine
    container_name:  redis
    hostname:  redis
    ports:
      - "6379:6379"

  springboot:
    build:
      context:  .
      dockerfile:  Dockerfile
    container_name:  sopo_redis
    depends_on:
      - redis
    ports:
      - "8080:8080"

Steps To Reproduce

No response

Compose Version

No response

Docker Environment

No response

Anything else?

No response

idsulik commented 3 months ago

Hi @GayeongKimm , could you please execute tree {path} command where {path} is the root directory with Dockerfile? it'll help to see the file structure. You can also check .dockerignore

ndeloof commented 3 months ago

Please try to reproduce with a plain docker build, and if same issue occurs, report to https://github.com/docker/buildx

GayeongKimm commented 3 months ago

안녕@GayeongKimmtree {path}, Dockerfile로 루트 디렉토리가 있는 명령을 실행해 주시겠어요 {path}? 파일 구조를 보는 데 도움이 될 거예요. 또한 확인할 수도 있어요..dockerignore

스크린샷 2024-07-30 오전 10 15 01

This is my project directory. I'm sending it like this because it's too long when I run the tree command And I don't have .dockerignore

GayeongKimm commented 3 months ago

Please try to reproduce with a plain docker build, and if same issue occurs, report to https://github.com/docker/buildx

It workde in local but not CI/CD what's wrong with my project?

GayeongKimm commented 3 months ago

I found a bug in my Gradle setup where I had specified the name of the .jar file, but this naming was not applied correctly in GitHub. I removed the code that specified the .jar file name and modified the Dockerfile. Finally, it worked! Thank you for help me.

Damilola94 commented 3 months ago

Please help I am having this issue in my bitbucket pipepline, it works well on local

failed to compute cache key: failed to calculate checksum of ref e349a683-0f89-40cd-88dc-b262a53b7195::oj9rbqd6dckxa583b6zgltvcj: "/app/.next/standalone": not found

It is nextjs 14.2.1 App

Please kindly assist

jb3rndt commented 1 month ago

Your question is NextJS specific, but in case anyone else stumbles upon this like I did, this solution worked for me: https://devonenote.com/solving-the-app-next-standalone-not-found-error-in-next-js/ Essentially, add output: 'standalone' to your next.config.(m)js.

bernardoforcillo commented 3 weeks ago

For nextjs can be also the node version, with 18 LTS, i revolved.