Skip to content

Docker build fails when targeting --platform linux/amd64, due to allocate virtual memory issue #5831

Closed
@ryanhefner

Description

@ryanhefner
  • I have tried with the latest version of Docker Desktop
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

Build should succeed, as it did in previous Docker Apple Silicon Preview versions.

Actual behavior

Build fails once it tries to execute a command, resulting in allocate virtual memory issue / core dumped, then just hangs.

 => [internal] load build definition from Dockerfile                                                                                                                         0.0s
 => => transferring dockerfile: 289B                                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                                            0.0s
 => => transferring context: 34B                                                                                                                                             0.0s
 => [internal] load metadata for docker.io/library/node:alpine                                                                                                               0.7s
 => [stage-1 1/3] FROM docker.io/library/node:alpine@sha256:b7e2d75ecd585feed57be69cd3dee973e5c498241e64906899b3baa2169fb35a                                                 0.0s
 => [internal] load build context                                                                                                                                            0.0s
 => => transferring context: 17.88kB                                                                                                                                         0.0s
 => CACHED [stage-1 2/3] WORKDIR /app                                                                                                                                        0.0s
 => CACHED [builder 3/7] COPY ./package*.json ./                                                                                                                             0.0s
 => CACHED [builder 4/7] COPY ./yarn.lock ./                                                                                                                                 0.0s
 => [builder 5/7] RUN yarn install --frozen-lockfile --prod                                                                                                                 11.2s
 => => # #                                                                                                                                                                       
 => => # # Fatal process OOM in CodeRange setup: allocate virtual memory                                                                                                         
 => => # #                                                                                                                                                                       
 => => # qemu: uncaught target signal 5 (Trace/breakpoint trap) - core dumped  

Information

  • macOS Version: 11.4
  • Intel chip or Apple chip: Apple M1
  • Docker Desktop Version: 3.5.1.7

Steps to reproduce the behavior

Dockerfile

FROM node:alpine AS builder
WORKDIR '/app'
COPY ./package*.json ./
COPY ./yarn.lock ./
RUN yarn install --frozen-lockfile --prod
COPY . .
RUN yarn build

FROM node:alpine
WORKDIR /app
COPY --from=builder /app .
EXPOSE 3000
CMD ["yarn", "start"]

Build command (ran via deploy.sh):

docker build --platform linux/amd64 -t $TAG_ENV -t $TAG_SHA -f ./services/$SERVICE/Dockerfile ./services/$SERVICE

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions