nx-tools
nx-tools copied to clipboard
nx-container build not pushing or loading images
I have followed the instructions in the documentation to either load an image into docker images or push to DockerHub by modifying the metadata section with project.json.
In both cases when I run the command, I get a warning 'No output specified with docker-container driver. Build result will only remain in the build cache.'. The command that was issues does not include the --load or --push options.
@AlanGRutter please share your config here 🙏🏻
@gperdomor I'm experiencing the same issue with our recently migration to NX/nx-container. Building images produces the error @AlanGRutter mentioned.
This is our nx-container configuration for an app (redacted sensitive info) in our project.json
"container": {
"executor": "@nx-tools/nx-container:build",
"dependsOn": ["build"],
"options": {
"engine": "docker",
"metadata": {
"images": [
"xxxxxxxxxxx.dkr.ecr.us-west-1.amazonaws.com/my-service"
],
"repository": "xxxxxxxxxxx.dkr.ecr.us-west-1.amazonaws.com",
"platforms": ["linux/arm64"],
"push": true,
"tags": [
"type=schedule",
"type=ref,event=branch",
"type=ref,event=tag",
"type=ref,event=pr",
"type=sha,prefix=sha-"
]
}
}
}
```
We are running this command in GH Actions via this step:
```yaml
# Run the `container` nx target
- name: Docker build & push
env:
INPUT_GITHUB_TOKEN: ${{ secrets.MY_GH_TOKEN }}
run: |
npx nx run-many -t container --parallel=5
Any help would be appreciated. We followed the documentation to set up the repo/project. Ie running...
nx g @nx-tools/nx-container:init
And selecting Docker
When we run the command in CI and locally, the image is produced, and we can docker run
the image, and the apps spin up no problem. It's just the push step that is failing for us.
The fix for us was to run the command with --push
option as well
npx nx run-many -t container --parallel=5 --push
The fix for us was to run the command with --push option as well
Thank you, ran into this issue and adding --push worked!
I think moving "push": true
out of the metadata
section into the root of options
should work as well.