Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@nx/node:setup-docker generator produces invalid Dockerfile #23365

Closed
1 of 4 tasks
MilanKovacic opened this issue May 14, 2024 · 1 comment · Fixed by #23452
Closed
1 of 4 tasks

@nx/node:setup-docker generator produces invalid Dockerfile #23365

MilanKovacic opened this issue May 14, 2024 · 1 comment · Fixed by #23452
Assignees
Labels
scope: node Issues related to Node, Express, NestJS support for Nx type: bug

Comments

@MilanKovacic
Copy link

Current Behavior

@nx/node:setup-docker produces the following Dockerfile:

COPY projectname

Resulting in the following error:

COPY requires at least two arguments

Expected Behavior

Dockerfile utiliizes COPY command correctly, providing the destination path.

GitHub Repo

No response

Steps to Reproduce

  1. Create a project, for example using @nx/nest generator
  2. Setup Docker using @nx/node:setup-docker generator
  3. Resulting Dockerfile contains invalid syntax

Nx Report

Node   : 20.13.0
OS     : darwin-arm64
npm    : 10.5.2

nx (global)        : 18.3.4
nx                 : 18.3.4
@nx/js             : 18.3.4
@nx/jest           : 18.3.4
@nx/linter         : 18.3.4
@nx/eslint         : 18.3.4
@nx/workspace      : 18.3.4
@nx/devkit         : 18.3.4
@nx/eslint-plugin  : 18.3.4
@nx/nest           : 18.3.4
@nx/node           : 18.3.4
@nx/playwright     : 18.3.4
@nx/react          : 18.3.4
@nrwl/tao          : 18.3.4
@nx/vite           : 18.3.4
@nx/web            : 18.3.4
@nx/webpack        : 18.3.4
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/vite/plugin
@nx/eslint/plugin
@nx/playwright/plugin
@nx/webpack/plugin
@nx/jest/plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@FrozenPandaz FrozenPandaz added the scope: node Issues related to Node, Express, NestJS support for Nx label May 14, 2024
@ndcunningham
Copy link
Contributor

Thanks! This will be fixed in the next release.

ndcunningham added a commit that referenced this issue May 16, 2024
Also fixes the unit tests for node package

closes: #23365
ndcunningham added a commit that referenced this issue May 16, 2024
Also fixes the unit tests for node package

closes: #23365
ndcunningham added a commit that referenced this issue May 16, 2024
Also fixes the unit tests for node package

## Currently

When you generate a docker file using either the node generator or the
node:setup-docker generator using inferred targets would create the
DockerFile but the COPY command would be incorrect.

It would resemble something similar to
```
//...

COPY   acme 

//etc...

```

## Expected

Now it generates the correct command.

```
//...

COPY dist/acme  acme/

//etc...

```

closes: #23365
FrozenPandaz pushed a commit that referenced this issue May 21, 2024
Also fixes the unit tests for node package

## Currently

When you generate a docker file using either the node generator or the
node:setup-docker generator using inferred targets would create the
DockerFile but the COPY command would be incorrect.

It would resemble something similar to
```
//...

COPY   acme

//etc...

```

## Expected

Now it generates the correct command.

```
//...

COPY dist/acme  acme/

//etc...

```

closes: #23365
(cherry picked from commit 1b7cf42)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: node Issues related to Node, Express, NestJS support for Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants