I am trying to deploy a Docker container with balena deploy app image which used to work but now I get this error:
Version: 11.30.12
$ ~/opt/balena-cli/balena deploy first-nuc 123456789012.dkr.ecr.eu-west-1.amazonaws.com/automation/xxx/yyyv1.0.18-linux-amd64
Error: no "Dockerfile[.*]", "docker-compose.yml" or "package.json" file
found in source folder "."
ExpectedError: Error: no "Dockerfile[.*]", "docker-compose.yml" or "package.json" file
found in source folder "."
at validateProjectDirectory (/usr/local/Cellar/balena-cli/11.30.6/libexec/lib/node_modules/balena-cli/build/utils/compose_ts.js:256:19)
From previous event:
at processImmediate (internal/timers.js:456:21)
From previous event:
at Command.action (/usr/local/Cellar/balena-cli/11.30.6/libexec/lib/node_modules/balena-cli/build/actions/deploy.js:167:8)
at /usr/local/Cellar/balena-cli/11.30.6/libexec/lib/node_modules/balena-cli/node_modules/capitano/build/command.js:98:37
at runNextTicks (internal/process/task_queues.js:62:5)
at processImmediate (internal/timers.js:429:9)
at process.topLevelDomainCallback (domain.js:137:15)
If you need help, don't hesitate in contacting our support forums at
https://forums.balena.io
For CLI bug reports or feature requests, have a look at the GitHub issues or
create a new one at: https://github.com/balena-io/balena-cli/issues/
Hi, when you push you need to be in the root of the project directory or provide the --source option . This is because it determines the build context that is sent to the balena builders to be built. If you push from the correct directory that error should disappear.
There is no build context or source. I am pushing an existing docker image from my local docker registry. I’ve already built the container. This worked just fine.
balena-cli ❯ ./balena deploy --help
Usage: deploy <appName> [image]
Usage: `deploy <appName> ([image] | --build [--source build-dir])`
Use this command to deploy an image or a complete multicontainer project to an
application, optionally building it first. The source images are searched for
(and optionally built) using the docker daemon in your development machine or
balena device. (See also the `balena push` command for the option of building
the image in the balenaCloud build servers.)
...
Hi, thanks. Yes I was able to reproduce this and our CLI team will investigate further and we’ll update as soon as we know anything. I notice that in the changelog here https://github.com/balena-io/balena-cli/blob/master/CHANGELOG.md#11270---2020-02-17 which is 11.27.0 we added Add project directory validation for balena push / build / deploy commands which seems related.
@magiconair, this issue should be fixed in CLI release 11.30.13. Thank you for reporting it. As Gareth had hinted, what happened is that project directory validation was added in release 11.27.0 for the push/build/deploy commands, but I had forgotten about the case of pre-built images where, as you pointed out, there is no build context or source. The CLI was incorrectly attempting to validate the current working directory as if it was a build context. Release 11.30.13 prevents this. Sorry for the trouble and thank you again for reporting it.