Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

[issue-15] reasonably support older linux distributions #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JustinVenus
Copy link

Targets Centos5+ abi compatibility. Uses same rust compiler version as the current Jessy8 based image, but uses the older libc-2.5 abi vs libc-2.19.

This could help enable a path towards binary releases in the future.

@JustinVenus
Copy link
Author

Showing the contents of the container with the change.

[root@f615b1063840 app]# ldd /usr/local/bin/linkerd-tcp
	linux-vdso.so.1 =>  (0x00007ffcbeb80000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007feb41055000)
	librt.so.1 => /lib64/librt.so.1 (0x00007feb40e4b000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007feb40c2f000)
	libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007feb40a21000)
	libc.so.6 => /lib64/libc.so.6 (0x00007feb406c7000)
	/lib64/ld-linux-x86-64.so.2 (0x000055adcfe9d000)
	libm.so.6 => /lib64/libm.so.6 (0x00007feb40444000)

[root@f615b1063840 app]# rpm -qf /lib64/libc.so.6
glibc-2.5-123.el5_11.3

[root@f615b1063840 app]# /usr/local/bin/linkerd-tcp --help
linkerd-tcp 0.0.2
A native TCP proxy for the linkerd service mesh

USAGE:
    linkerd-tcp <PATH>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <PATH>    Config file path.

@klingerf
Copy link
Contributor

Hey @JustinVenus, thanks for putting this together! This approach looks good, but would you mind putting it in a separate Dockerfile (maybe Dockerfile-centos or similar)? @stevej and I have been talking about ways to slim down the default docker image that we produce, so I think this file is going to change substantially as part of that effort. If we put these changes in a separate file, then we won't need to be as mindful about image size there.

@JustinVenus
Copy link
Author

@klingerf I've made the suggested changes. Thanks for the quick feedback 😄

@klingerf
Copy link
Contributor

@JustinVenus Ok, great, thanks for updating. Can you also add a note about how to use this new Dockerfile in the Packaging section of the README? Sorry, should have mentioned yesterday. Otherwise looks good to me, but I want @olix0r to have a look too.

@JustinVenus
Copy link
Author

@klingerf I was looking at what you've posted for issue 20 and you inspired me. How about a build script instead of a docker image? The output could be used for binary releases (which I personally prefer to docker images).

#!/bin/bash

IMAGE=alexcrichton/rust-slave-dist:2015-10-20b
TARGET=x86_64-unknown-linux-gnu
RUST_VERSION=1.16.0
RUST_SOURCE="https://static.rust-lang.org/dist/rust-${RUST_VERSION}-${TARGET}.tar.gz"

if [[ -d "target/${TARGET}" ]]; then
    rm -rf "target/${TARGET}"
fi

docker run \
    --rm -v `pwd`:/rust/app \
    -u root \
    -w /rust/app \
    --entrypoint=/bin/bash \
    ${IMAGE} \
    -c "cd /tmp && \
    (curl -L ${RUST_SOURCE} | gzip -dc | tar xf -)&& \
    ./rust-${RUST_VERSION}-${TARGET}/install.sh --without=rust-docs && \
    cd - && \
    cargo build --release --target=${TARGET}"

The produced binary works on (Ubuntu-12.04 and Centos5, I suspect newer distros will work just the same) w/o requiring any installation of extra packages.

$ ./linkerd-tcp --help
linkerd-tcp 0.0.2
A native TCP proxy for the linkerd service mesh

USAGE:
    linkerd-tcp <PATH>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

ARGS:
    <PATH>    Config file path.

$ ldd linkerd-tcp
	linux-vdso.so.1 =>  (0x00007fff5d129000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd26c731000)
	librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd26c529000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd26c30b000)
	libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd26c0f5000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd26bd37000)
	/lib64/ld-linux-x86-64.so.2 (0x00007fd26cfda000)
	libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd26ba3a000)

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.5 LTS"

@klingerf
Copy link
Contributor

@JustinVenus Totally -- I think build script is a better approach, since we're not intending for folks to use the centos docker image, just the binary. I'm not 100% sure how we want this repo organized (@olix0r's back on Monday and can comment), but I'd suggest creating a new bin/ dir, and putting the script in there.

@JustinVenus
Copy link
Author

@klingerf not sure how you all feel about Make, but I've updated this review with a Makefile and documentation in the /README.md.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants