Skip to content

Unable to build Docker image - node_modules missing #626

@liv-io

Description

@liv-io

Summary

Building the Dockerfile fails for me at the step:

FROM ubuntu-nodejs as cardano-services
<...>
COPY --from=cardano-services-production-deps /app/packages/cardano-services/node_modules /app/packages/cardano-services/node_modules

With the error:

[5/7] STEP 4/14: COPY --from=cardano-services-production-deps /app/packages/cardano-services/node_modules /app/packages/cardano-services/node_modules

Error: error building at STEP "COPY --from=cardano-services-production-deps /app/packages/cardano-services/node_modules /app/packages/cardano-services/node_modules": checking on sources under "~/<overlay-fs>/": copier: stat: "/app/packages/cardano-services/node_modules": no such file or directory

When exec-ing into the build hash, I cannot find any directory with the name above:

<...>
[4/7] STEP 1/2: FROM 4b7823318e537f99c02098c6bcd5536c155c5fe1fab27a77d5221f582f61772c AS cardano-services-production-deps
[4/7] STEP 2/2: RUN yarn workspaces focus --all --production
--> Using cache 71ef3297c9b18ef8b30272d31b1dcbd581c713111180656deeb07da7d43a5e77
--> 71ef3297c9b
<...>
podman run -ti 71ef3297c9b /bin/bash
root@df7e171ac3f9:/app# ls -l /app/packages/cardano-services/node_modules
ls: cannot access '/app/packages/cardano-services/node_modules': No such file or directory

Steps to reproduce the bug

  1. git clone https://github.com/input-output-hk/cardano-js-sdk.git
    
  2. cd ./cardano-js-sdk/
    
  3. docker build .
    

Actual Result

Error: error building at STEP "COPY --from=cardano-services-production-deps /app/packages/cardano-services/node_modules /app/packages/cardano-services/node_modules": checking on sources under "~/<overlay-fs>/": copier: stat: "/app/packages/cardano-services/node_modules": no such file or directory

Expected Result

The Docker build command should work without throwing an error message.

SDK version

I don't understand how the SDK is versioned.

Environment type

  • Node.js
  • Browser
  • Browser Extension
  • Other

Environment details

Build environment

  • Ubuntu 22.04 LTS
  • Podman 3.4.4+ds1-1ubuntu1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions