question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dockerfile build error /app/nobelium/node_modules/@next/swc-linux-x64-gnu/next-swc.linux-x64-gnu.node: __snprintf_chk: symbol not found

See original GitHub issue

Describe the bug Dockerfile build error

Error: Error relocating /app/nobelium/node_modules/@next/swc-linux-x64-gnu/next-swc.linux-x64-gnu.node: __snprintf_chk: symbol not found at Object.Module._extensions…node (internal/modules/cjs/loader.js:1144:18) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:93:18) at Object.<anonymous> (/app/nobelium/node_modules/next/dist/build/swc/index.js:29:20) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) { code: ‘ERR_DLOPEN_FAILED’ } error - Failed to load SWC binary, see more info here: https://nextjs.org/docs/messages/failed-loading-swc error Command failed with exit code 1

Dockerfile Dockerfile based on https://github.com/craigary/nobelium/blob/main/Dockerfile

FROM node:14-alpine AS deps
WORKDIR /app
RUN apk add --no-cache --update tzdata git openssh libc6-compat && \
    ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
    echo "Asia/Shanghai" > /etc/timezone && \
    apk del tzdata
RUN git clone --depth=1 https://github.com/craigary/nobelium.git
WORKDIR /app/nobelium
RUN yarn install --frozen-lockfile
ENV NOTION_PAGE_ID xxxx
RUN yarn build
ENV NODE_ENV production
EXPOSE 3000
CMD ["yarn", "start"]

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
xukechengcommented, Nov 8, 2021

it will report this error:

yarn install v1.22.5
[1/4] Resolving packages...
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.

So, When I just use “yarn install”, it work well.

Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

docker build command fails on yarn install step with error "gyp ...
I'm trying to follow the getting-started tutorial on a Raspberry Pi 4 with Debian 10 installed, but I'm running into some issues.
Read more >
Cannot find module for a node js app running in a docker ...
If your Dockerfile and package.json files are correct and still have the issue: Make sure you've rebuilt your container images. Try. docker-compose down...
Read more >
Best practices for writing Dockerfiles - Docker Documentation
This document covers recommended best practices and methods for building efficient images. Docker builds images automatically by reading the instructions from a ...
Read more >
Use kaniko to build Docker images - GitLab Docs
More details on what other GitLab CI patterns are demonstrated are available at the project page. Troubleshooting. 403 error: “error checking push permissions”....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found