docker / getting-started

Getting started with Docker
Apache License 2.0
2.91k stars 6.4k forks source link

ERROR: failed to solve: process "/bin/sh -c yarn install --production" did not complete successfully: exit code: 1 #432

Open tranthomanh opened 8 months ago

tranthomanh commented 8 months ago

Hello, i'm trying to use Docker in window 11 when following the getting started tutorial from this site: https://docs.docker.com/get-started/02_our_app/. But in step 3, after using command: docker build -t getting-started, I'm getting an issue:

ERROR: failed to solve: process "/bin/sh -c yarn install --production" did not complete successfully: exit code: 1 This is full console screen: PS D:\Docker\getting-started-app> docker build -t getting-started . [+] Building 3.7s (12/12) FINISHED docker:default => [internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 188B 0.0s => resolve image config for docker.io/docker/dockerfile:1 1.7s => [auth] docker/dockerfile:pull token for registry-1.docker.io 0.0s => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021 0.0s => [internal] load metadata for docker.io/library/node:18-alpine 1.6s => [auth] library/node:pull token for registry-1.docker.io 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [1/4] FROM docker.io/library/node:18-alpine@sha256:ca9f6cb0466f9638e59e0c249d335a07c867cd50c429b5c7830dda1bed584649 0.0s => [internal] load build context 0.0s => => transferring context: 4.33kB 0.0s => CACHED [2/4] WORKDIR /app 0.0s => CACHED [3/4] COPY . . 0.0s => ERROR [4/4] RUN yarn install --production 0.3s

[4/4] RUN yarn install --production: 0.272 exec /bin/sh: exec format error

Dockerfile:6

4 | WORKDIR /app 5 | COPY . . 6 | >>> RUN yarn install --production 7 | CMD ["node", "src/index.js"] 8 | EXPOSE 3000

ERROR: failed to solve: process "/bin/sh -c yarn install --production" did not complete successfully: exit code: 1

Please help me solve it! Thank you