0

Im trying to create a 32bit docker image, that has Googles gRPC on it.

I have created the Dockerfile extending from:

FROM  i386/ubuntu:17.04

I am able to compile both gRPC and Proto Buffers, however, when I try to use protoc I get bash: /usr/local/bin/protoc: No such file or directory.

When I run file, I see that the assembly is seen as 64bit.

file /usr/local/bin/protoc          
/usr/local/bin/protoc: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.18, BuildID[sha1]=e87bf6eb1c507bb7f65f3c7687df6a3b41b563be, stripped

My question, therefore, is how to write and build a docker image that is actually 32bit. When I run uname -m or arch in the container I get x86_64, but dpkg --print-architecture shows i386 so it would seem that it's not actually a 32bit image.

whackamadoodle3000
  • 6,684
  • 4
  • 27
  • 44
Magick
  • 4,603
  • 22
  • 66
  • 103
  • Note: the "No such file or directory" refers to the ELF INTERP: `/lib64/ld-linux-x86-64.so.2` – o11c Sep 15 '17 at 01:38
  • 1
    You can fix the `uname` issue using `setarch(8)` ... how are you compiling? Remember gcc doesn't care about `uname` *or* about `dpkg`, only what it was configured as. Perhaps you're looking for `-m32`? – o11c Sep 15 '17 at 01:39
  • Ok. Thanks. When compiling Proto Buffers, where do I use the `-m32` arg? – Magick Sep 15 '17 at 01:51
  • `./configure CC='gcc -m32' CXX='g++ -m32'` – o11c Sep 15 '17 at 01:55

0 Answers0