If I want to deploy an existing container, for which the image exists in a public registry, to a device, what is the right way to do that?
Some experimentation suggests that I can make a trivial Dockerfile wrapper than just uses:
FROM: myregistry.io/image:latest
and do the expected balena push my_application
. Is that a wrong/bad way of doing it?
As a follow-up to that, and this might be more of a Docker question than a Balena question:
How can I map some regular command line docker run
options to the container that I am pushing out to devices?
It looks like env variables I can do either in the dashboard or with ENV FOO=fooval
inside the dockerfile, if I use the “trivial wrapper” technique above.
But publishing ports, easy with docker cli, e.g. --publish 1680:1680/udp
, I am not sure how to do.
It looks like EXPOSE
doesn’t actually do anything?
The one forum answer I found was to make this configuration in a docker-compose.yml file; is it the case that I will need to “compose” even for a single container, if I want to get the ports set up for my device in the same way as I could get with the CLI invocation of --publish 1680:1680/udp
?
I want to accomplish a similar mapping for CLI options like --restart always
, --mount type=bind,source....
… I am still reading through the Dockerfile reference (I’m new to actually building containers, always have just “run” them as needsbe) to see if there’s an answer there.
But the same question as above applies: for some expected set of CLI options, should I create a specialization as a Dockerfile or docker-compose wrapped around the existing container?