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

Cannot build with docker buildkit on arm64 #3716

Open
4 tasks done
polRk opened this issue Mar 28, 2024 · 8 comments
Open
4 tasks done

Cannot build with docker buildkit on arm64 #3716

polRk opened this issue Mar 28, 2024 · 8 comments
Labels
need more info Further information is requested stale

Comments

@polRk
Copy link

polRk commented Mar 28, 2024

Describe the bug

Infinite loading during docker build

#15 [build 6/6] RUN npm run build
#15 1.187 
#15 1.187 > pkg@0.0.0 build
#15 1.187 > vitepress build
#15 1.187 
#15 2.044 
#15 2.044   vitepress v1.0.1
#15 2.044 
#15 2.072 - building client + server bundles...

Reproduction

ARG NODE_IMAGE=node
ARG NODE_VERSION=20.11.1-alpine

ARG NGINX_IMAGE=nginx
ARG NGINX_VERSION=1.25.1-alpine

FROM $NODE_IMAGE:$NODE_VERSION as build
WORKDIR /app

COPY .npmrc package.json package-lock.json ./
RUN --mount=type=secret,id=TOKEN NPM_REGISTRY_TOKEN=$(cat /run/secrets/TOKEN) npm ci

COPY .vitepress content ./
RUN npm run build <<< **INFINITE PROGRESS**

FROM $NGINX_IMAGE:$NGINX_VERSION as final

# Настройка Nginx
RUN touch /var/run/nginx.pid \
	&& chown -R nginx:nginx /var/cache/nginx /var/run/nginx.pid
COPY nginx.conf /etc/nginx/nginx.conf

COPY --from=build /app/.vitepress/dist/ /usr/share/nginx/html

USER nginx

EXPOSE 8080

ENTRYPOINT ["nginx", "-g", "daemon off;"]

Expected behavior

The build phase should be completed quickly

System Info

System:
    OS: macOS 14.3.1
    CPU: (8) arm64 Apple M1
    Memory: 143.84 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.6.1 - /opt/homebrew/opt/node@20/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.2.4 - /opt/homebrew/opt/node@20/bin/npm
    bun: 1.0.25 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 114.0.5735.198
    Safari: 17.3.1

Additional context

No response

Validations

@polRk polRk added the bug: pending triage Maybe a bug, waiting for confirmation label Mar 28, 2024
@brc-dd
Copy link
Member

brc-dd commented Mar 28, 2024

Install git or disable lastUpdated. alpine doesn't have that installed by default.

@brc-dd brc-dd closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2024
@polRk
Copy link
Author

polRk commented Mar 28, 2024

Install git or disable lastUpdated. alpine doesn't have that installed by default.

It solved problem with git ENOET, but But that's not the problem

@polRk
Copy link
Author

polRk commented Mar 28, 2024

@brc-dd Reopen please, you are wrong

@polRk
Copy link
Author

polRk commented Mar 28, 2024

image

@brc-dd brc-dd reopened this Mar 28, 2024
@brc-dd
Copy link
Member

brc-dd commented Mar 28, 2024

Please share a minimal reproducible example.

@brc-dd brc-dd added need more info Further information is requested and removed bug: pending triage Maybe a bug, waiting for confirmation labels Mar 28, 2024
@polRk
Copy link
Author

polRk commented Mar 28, 2024

@brc-dd github.com:polRk/vitpress-101-docker-bug.git

Run on Apple Silicon

@polRk
Copy link
Author

polRk commented Mar 28, 2024

I think the problem is that I am building an image for amd64 on arm64.

FROM --platform=linux/amd64. I need it line.

@brc-dd
Copy link
Member

brc-dd commented Mar 28, 2024

works fine on my mac:

 => [final 2/4] RUN touch /var/run/nginx.pid  && chown -R nginx:nginx /var/cache/nginx /var/run/nginx.pid                                                                                    0.1s
 => [final 3/4] COPY nginx.conf /etc/nginx/nginx.conf                                                                                                                                        0.0s
 => [build 5/6] COPY .vitepress content ./                                                                                                                                                   0.0s
 => [build 6/6] RUN npm run build                                                                                                                                                            4.6s
 => [final 4/4] COPY --from=build /app/.vitepress/dist/ /usr/share/nginx/html                                                                                                                0.0s

Preview kind of breaks but you'll need to adjust CSP headers added by nginx for that.

@github-actions github-actions bot added the stale label Apr 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info Further information is requested stale
Projects
None yet
Development

No branches or pull requests

2 participants