akc42
akc42

Reputation: 5001

Can I build Docker contains for a Raspberry Pi on a AMD64 machine?

I am exploring using Docker containers on a Raspberry PI to help with managing upgrades to my application and the versions of NodeJS that it runs with.

I am wondering how the best way to build the containers would be. I could build the containers in the production machine, but it would be much more convenient if I could start with (say) the latest armvf nodejs image and build a new image with the application sources added (along with npm modules and bower components) that the application needs on my Home Desktop (Debian AMD64) or Laptop (OSX) or the Windows 7 machine I have available at work. I don't need to run the containers, just build them.

One slight niggle is that the code needs to be kept confidential, so I can't put the resultant containers in any public repository. Can I ensure the containers have managable names and can I just copy them around between machines?

Upvotes: 0

Views: 506

Answers (1)

fzgregor
fzgregor

Reputation: 1897

AFAIK containers are architecture agnostic. You should be able to modify them one a host with a different architecture, but will be unable to enter it. Entering basically means executing a program (e.g. a shell) in the container's context. Since the container's shell is not executable on your host this won't work. Consequently cross-compiling within the container is also no option.

However, if you cross-compile on the outside, you should be able to add your executables to the image, move it over to your pi and run it.

You can move docker images without any public repository either with a private repository or you use docker save IMAGE > image.tar to store an image in a tarball, move it to the pi, and use docker load -i image.tar to restore it.

Upvotes: 2

Related Questions