Created
November 22, 2017 12:01
-
-
Save shibukawa/3a1efc7d0098548172706f177edd5bd4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:latest as builder | |
ADD src src | |
WORKDIR src | |
RUN npm install && \ | |
npm run build | |
FROM node:alpine as runner | |
COPY src/package.json . | |
RUN apk update && \ | |
apk add --no-cache libc6-compat | |
COPY --from=builder /src/dist/convert.js / | |
COPY --from=builder /src/node_modules/sharp /node_modules/sharp | |
RUN npm install --only=production | |
CMD ["node", "convert.js"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:alpine as builder | |
RUN apk update && \ | |
apk add --no-cache \ | |
libc6-compat \ | |
alpine-sdk | |
ADD src src | |
WORKDIR src | |
RUN npm install && \ | |
npm run build | |
FROM node:alpine as runner | |
COPY src/package.json . | |
RUN apk update && \ | |
apk add --no-cache libc6-compat | |
COPY --from=builder /src/dist/convert.js / | |
COPY --from=builder /src/node_modules/sharp /node_modules/sharp | |
RUN npm install --only=production | |
CMD ["node", "convert.js"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YoshikinoMBP% docker run -v `pwd`/work:/work --rm 51c9b6110c00 | |
module.js:670 | |
return process.dlopen(module, path.toNamespacedPath(filename)); | |
^ | |
Error: Error loading shared library /node_modules/sharp/build/Release/sharp.node: Exec format error | |
at Object.Module._extensions..node (module.js:670:18) | |
at Module.load (module.js:560:32) | |
at tryModuleLoad (module.js:503:12) | |
at Function.Module._load (module.js:495:3) | |
at Module.require (module.js:585:17) | |
at require (internal/module.js:11:18) | |
at Object.<anonymous> (/node_modules/sharp/lib/constructor.js:9:15) | |
at Module._compile (module.js:641:30) | |
at Object.Module._extensions..js (module.js:652:10) | |
at Module.load (module.js:560:32) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment