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

x86_64 images #47

Closed
lmakarov opened this Issue Jun 21, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@lmakarov

lmakarov commented Jun 21, 2015

Are there plans to have a x86_64 version?
I need to run an 64bit-only app inside a container and wanted to use the alpine docker image, but realized there is only a 32bit version.

@jumanjiman

This comment has been minimized.

Show comment
Hide comment
@jumanjiman

jumanjiman Jun 21, 2015

how did you determine that there is only a 32-bit version?

it looks like 64-bit to me:

$ docker run --rm -it alpine:3.2 sh
/ # apk update
fetch http://dl-4.alpinelinux.org/alpine/v3.2/main/x86_64/APKINDEX.tar.gz
v3.2.0-41-g0cfd265 [http://dl-4.alpinelinux.org/alpine/v3.2/main]
OK: 5258 distinct packages available

/ # apk info -P musl
musl-1.1.9-r2 provides:
so:libc.musl-x86_64.so.1=1

/ # apk add file
(1/1) Installing file (5.22-r0)
Executing busybox-1.23.2-r0.trigger
OK: 9 MiB in 16 packages

/ # file -L /bin/sh
/bin/sh: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, stripped

/ # /lib/ld-musl-x86_64.so.1 --list /bin/busybox 
        /lib/ld-musl-x86_64.so.1 (0x7fa8f50e2000)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fa8f50e2000)

jumanjiman commented Jun 21, 2015

how did you determine that there is only a 32-bit version?

it looks like 64-bit to me:

$ docker run --rm -it alpine:3.2 sh
/ # apk update
fetch http://dl-4.alpinelinux.org/alpine/v3.2/main/x86_64/APKINDEX.tar.gz
v3.2.0-41-g0cfd265 [http://dl-4.alpinelinux.org/alpine/v3.2/main]
OK: 5258 distinct packages available

/ # apk info -P musl
musl-1.1.9-r2 provides:
so:libc.musl-x86_64.so.1=1

/ # apk add file
(1/1) Installing file (5.22-r0)
Executing busybox-1.23.2-r0.trigger
OK: 9 MiB in 16 packages

/ # file -L /bin/sh
/bin/sh: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-musl-x86_64.so.1, stripped

/ # /lib/ld-musl-x86_64.so.1 --list /bin/busybox 
        /lib/ld-musl-x86_64.so.1 (0x7fa8f50e2000)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fa8f50e2000)
@lmakarov

This comment has been minimized.

Show comment
Hide comment
@lmakarov

lmakarov Jun 21, 2015

I've been trying to get docker-compose to run in an alpine based container and considered the following behavior as an architecture mismatch:

bash-4.3# ls -la /usr/local/bin/docker-compose
-rwxr-xr-x    1 root     root       8158917 Jun 21 12:32 /usr/local/bin/docker-compose
bash-4.3# docker-compose
bash: /usr/local/bin/docker-compose: No such file or directory
bash-4.3#

Apparently I was missing some dependencies. Found a working docker-compose alpine based image here:
https://github.com/wharsojo/wharsojo-docker-compose/blob/master/Dockerfile

The difference in image size is terrifying!
30.41 MB (alpine/docker-compose) vs 416.7 MB (debian/docker-compose) :D

lmakarov commented Jun 21, 2015

I've been trying to get docker-compose to run in an alpine based container and considered the following behavior as an architecture mismatch:

bash-4.3# ls -la /usr/local/bin/docker-compose
-rwxr-xr-x    1 root     root       8158917 Jun 21 12:32 /usr/local/bin/docker-compose
bash-4.3# docker-compose
bash: /usr/local/bin/docker-compose: No such file or directory
bash-4.3#

Apparently I was missing some dependencies. Found a working docker-compose alpine based image here:
https://github.com/wharsojo/wharsojo-docker-compose/blob/master/Dockerfile

The difference in image size is terrifying!
30.41 MB (alpine/docker-compose) vs 416.7 MB (debian/docker-compose) :D

@lmakarov lmakarov closed this Jun 21, 2015

@jumanjiman

This comment has been minimized.

Show comment
Hide comment
@jumanjiman

jumanjiman Jun 21, 2015

considered the following behavior as an architecture mismatch:

it turns out to be a libc mismatch.
docker-compose uses pyinstaller to create a standalone executable,
but it's dynamically linked against glibc in their case.

it's useful to run /lib/ld-linux-*.so --list <bin> to see which libc a prog is linked to.

the other day i looked at https://github.com/docker/compose/blob/master/Dockerfile with a thought to converting that debian-based builder into an alpine-based builder. the end result should be standalone docker-compose linked with musl instead of glibc. 😁

in cases where you want to put a closed-source binary into an alpine container, this trick to get glibc in alpine is useful.

jumanjiman commented Jun 21, 2015

considered the following behavior as an architecture mismatch:

it turns out to be a libc mismatch.
docker-compose uses pyinstaller to create a standalone executable,
but it's dynamically linked against glibc in their case.

it's useful to run /lib/ld-linux-*.so --list <bin> to see which libc a prog is linked to.

the other day i looked at https://github.com/docker/compose/blob/master/Dockerfile with a thought to converting that debian-based builder into an alpine-based builder. the end result should be standalone docker-compose linked with musl instead of glibc. 😁

in cases where you want to put a closed-source binary into an alpine container, this trick to get glibc in alpine is useful.

@0rax

This comment has been minimized.

Show comment
Hide comment
@0rax

0rax Jun 23, 2015

Hi, just to let you know, i've been able to run some glibc binary on alpine-linux by calling explicitly the musl runtime like this:

$ /lib/ld-musl-x86_64.so.1 bin args

It could have some side-effect as exposed here: http://www.musl-libc.org/faq.html (section: Is musl compatible with glibc?)
But you might wanna give it a try.

0rax commented Jun 23, 2015

Hi, just to let you know, i've been able to run some glibc binary on alpine-linux by calling explicitly the musl runtime like this:

$ /lib/ld-musl-x86_64.so.1 bin args

It could have some side-effect as exposed here: http://www.musl-libc.org/faq.html (section: Is musl compatible with glibc?)
But you might wanna give it a try.

@Clement-TS

This comment has been minimized.

Show comment
Hide comment
@Clement-TS

Clement-TS Apr 26, 2018

apk add -U py-pip
pip install docker-compose

Clement-TS commented Apr 26, 2018

apk add -U py-pip
pip install docker-compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment