Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M1 芯片使用Arch Linux 虚拟机无法使用docker-compose #185

Open
vinniedaboi opened this issue Mar 28, 2023 · 5 comments
Open

M1 芯片使用Arch Linux 虚拟机无法使用docker-compose #185

vinniedaboi opened this issue Mar 28, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@vinniedaboi
Copy link

Description

在使用docker-compose up -d 出现问题 

Reproduce

  1. sudo docker-compose up -d
    ...

Expected behavior

Current behavior

failed to compute cache-key...

Screenshots/Terminal log

Environments

  • OS: Arch Linux aarch64 QEMU
  • Version: 1.5.0

Screenshot 2023-03-28 at 12 18 35 PM

@WangYihang
Copy link
Owner

看起来您好像是直接下载 master.zip?所以导致 .git 文件夹不存在。

是否有试过 git clone?

@WangYihang
Copy link
Owner

哦,也有可能是你的 cwd 在 deployments 下面。

试试:

cd ~/Projects/Platypus
docker compose -f deployments/docker-compose.yml up

@WangYihang WangYihang self-assigned this Mar 29, 2023
@WangYihang WangYihang added the bug Something isn't working label Mar 29, 2023
@vinniedaboi
Copy link
Author

vinniedaboi commented Mar 30, 2023

使用git clone也一样,这里可以看到有.git文件夹
Screenshot 2023-03-30 at 9 36 29 PM

@ThomasRitaine
Copy link

The issue comes from the fact that that stage of the Dockerfile requires the .git directory to be in the deployments directory.

# Stage 1: Prepare source code
FROM alpine/git as source
WORKDIR /app
COPY .git .git
RUN git checkout .

So, to fix the issue, you need to copy the root .git directory to deployments directory as so:

cp -r .git deployments

@WangYihang
Copy link
Owner

Thank you so much for providing the solution. @ThomasRitaine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants