Skip to content

COPY command causes compose.up process to fail #41

@neg-0

Description

@neg-0

I'm using the following Dockerfile inside of a nodejs repository.

  # Pull base image
  FROM node:latest

  # Set working directory
  WORKDIR /usr/src/app

  # Install app dependencies
  COPY package*.json ./
  RUN npm install

  # Copy app files
  COPY . .

  # Start the app
  EXPOSE 3000

  # Run the app
  CMD [ "npm", "start" ]

The COPY package*.json ./ command causes the compose.up() function to fail due to the way source files are configured in serviceTools.js

if (dockerfile !== null) {
obj['dockerfile'] = path.basename(dockerfile);
let streami = await docker.buildImage(
{
context: buildPath,
src: [dockerfile],
},
obj
);

According to the dockerode docs https://github.com/apocas/dockerode#building-an-image, the value of src must include ALL files that will be referenced in a command such as COPY. Is there a workaround or plan to include files other than Dockerfile in the source files array?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions