-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
32-bit container on a 64-bit system #611
Comments
It should work, but there is a trick. When you start a container with
|
/cc @unclejack |
Oh :-) For some reason, I thought that backjlack and unclejack were two On Wed, May 15, 2013 at 7:26 AM, Victor Vieux notifications@github.comwrote:
|
I've had to add the following 64 bit libraries to the 32 bit image in order to get it to work with docker:
The image was working afterwards. |
Hmm, wish I'd seen this earlier :). Anyway, I've had success building with a linux/386 go cross-compiler to get a 32bit docker to resolve the injection issue. Also helps to run things with 'linux32', otherwise package tools get confused. I'd love to see (and would be happy to contribute to) first-class support for this sort of thing. |
@dtzWill Would you mind sharing how you've made this work? I'm interested to know how you got docker 64bit to run docker 32bit in the container. |
@unclejack sure thing. 'm not running any part of docker as 64bit, simply built docker as 32bit and disabled the amd64 check in server.go Longer-term I'd love to see a more pervasive concept of container architecture, but my original intended short-term plan for this was:
However since simply building docker 32bit seems to work (and also works on 64bit containers I've tried so far, YMMV) I haven't pursued this. |
While we're on the topic, for bonus points docker could support non-native architectures (say, ARM) using qemu-user-static, which apparently the ubuntu folks use with lxc-create [1]. I don't know how well this fits into the general goals of docker, but it might be relatively simple to implement and is something quite a few people would find rather useful. Just a thought :). |
All of this fits in docker's goals :) Great stuff. A good and easy first step is to add the field in the image data. Someone let me know if you want to give it a try. Cross-compile: also a good Par to make, the build environment is itself a docker container - you can play with the dockerfile in hack/dockerbuilder. Injecting right docker-init: is this necessary? The version running in the host and the version which will work as init should always be the same, no? On Wed, May 22, 2013 at 4:07 PM, Will Dietz notifications@github.com
|
I'll try to hack something up with qemu-user* and try to add that field. |
For testing the use case described in this issue (which shouldn't require qemu), these two images I uploaded to the index might be useful: https://index.docker.io/u/wdtz/debian-6.0-x86/ These execute with 32bit docker just fine, but ideally one wouldn't need a special build of docker for 32bit vs 64bit on a 64bit host. |
This is an excellent thread, but it covers a lot of ground and is not immediately actionable so I'm closing the issue. Feel free to continue the discussion on the mailing list, or file specific improvement requests if needed. |
@dtzWill @unclejack How did you create 32-bit docker containers? I'm trying to make 32-bit debian container. I took contrib/mkimage-debian.sh and added |
uname will always tell you 64 bits. Look at e.g. "file /bin/sh" to see the
|
@jpetazzo You are right, |
Yup, personality is different (it goes in the way to "pretend" the kernel
|
Pinging for a status update on being able to create 32 bit containers. @shamrin the link to the mkimage script is broken... |
That'd be because mkimage-debian.sh got renamed to mkimage-debootstrap.sh (since it works equally well for Ubuntu), and even now has an undocumented -a flag to control the arch (undocumented because docker doesn't support any other arches yet). |
Here's the link to make it easier to find: mkimage-debootstrap.sh. |
Or use an existing 32-bit image, here's one for precise: https://index.docker.io/u/besn0847/ubuntu32/ |
I have 32-Bit Fedora 20 build of Docker. The builds just completed about 10 mins ago. You will have to tweak the init scripts to launch the daemon, but it works and tested. Here, pick up a copy from my github repo: https://github.com/rcsavage/Docker-1.2.0-i686 |
For anyone coming across this, like I have.. it's always possible to run a command in 32 bit mode. Test it, by issuing |
How could I use linux32 command if I have 32bit container (here my question about uname on SO)? |
Ubuntu amd64 installations enable 32-bit foreign architecture by default, however the docker containers do not appear to feature that. I guess that is a request to the official ubuntu container providers to either add 32-bit support by default and/or provide alternative images with 32-bit runtime support built-in. |
@xnox : We have 32-bit containers here: https://github.com/docker-32bit If you'd like to test, we could sure use any volunteers to confirm which 32-bit Ubuntu versions support Docker 32-bit (we're targeting LTS only). |
@Kentoseth All i386 releases of ubuntu should be able support docker-32bit. I'm asking to build: amd64 image of Ubuntu with 32-bit runtime support as part of the image, to be executed on an amd64 host, with an amd64 docker binary. The same way that Ubuntu Desktop amd64 installations have i386 runtime support enabled which allows installation and execution of i386 packages (e.g. install hello:i386 on amd64 host to execute i386 version of hello, similarly for libraries, and even high-level apps like Skype). |
I think I understand you now. Unfortunately I can't help concerning that. Hope someone else can chime in. |
@shamrin I have checked (in Ubuntu)
Some 32bits images (Ubuntu 12.04 / 14.04)
|
Anybody tested it with 1.5? |
@dexterddit yes, works.
|
@ggrandes Thank you |
How can we help with 32 bit ubuntu ? Anyone having proper buildscripts to create 32bit docker.debs ? |
@voidzero. I have read about this solution as some kind of a replacement to unprefixed On x86_32 ( Linux 0e0418f9b555 4.9.87-linuxkit-aufs #1 SMP Fri Mar 16 18:16:33 UTC 2018 i686 i686 i686 GNU/Linux On x86_64 ( Linux c1d04cd36841 4.9.87-linuxkit-aufs #1 SMP Fri Mar 16 18:16:33 UTC 2018 i686 i686 i686 GNU/Linux what gives? The idea is to "distinguish" whether the OS is x86 or x64, like happens in a real VM (regardless of the host's architecture). |
@kasper3, I use linux32 as entrypoint in my 32bit containers. We use single installer for both 32&64 bit systems, installer check architecture and install either 32 bit or 64 bit binaries. Without linux32 installer will install 64bit binaries which would not run as there are no 64bit libs in 32bit image. So in my use case I need both: 32bit image and linux32 as entrypoint. |
@isanych, copy that, makes sense. Thanks! |
@kasper3, from my point of view 32 bit containers with linux32 trick are quite usable as is. |
I understand that docker supports only amd64 for now. Does it support 32 bit containers? I want to containerize a 32-bit application with docker.
Ubuntu guide mentions that LXC supports this:
lxc-create -a i386
.The text was updated successfully, but these errors were encountered: