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

Commit 92eca70

Browse files
committed
[issue-15] reasonably support older linux distributions
1 parent b6ded1d commit 92eca70

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
target
2+
/rust-*.tar.gz

Makefile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
RUST_VERSION = 1.16.0
2+
DOCKER_IMAGE = alexcrichton/rust-slave-dist:2015-10-20b
3+
RUST_TARBALL = rust-$(RUST_VERSION)-x86_64-unknown-linux-gnu.tar.gz
4+
RUST_SOURCE = https://static.rust-lang.org/dist/$(RUST_TARBALL)
5+
6+
ifeq ($(shell uname -s),Darwin)
7+
all: linux darwin
8+
9+
darwin: target/x86_64-apple-darwin/release/linkerd-tcp
10+
11+
target/x86_64-apple-darwin/release/linkerd-tcp:
12+
cargo build --release --verbose --target=x86_64-apple-darwin
13+
14+
else
15+
all: linux
16+
endif
17+
18+
linux: $(RUST_TARBALL) target/x86_64-unknown-linux-gnu/release/linkerd-tcp
19+
20+
$(RUST_TARBALL):
21+
curl -L -o $(RUST_TARBALL) $(RUST_SOURCE)
22+
23+
target/x86_64-unknown-linux-gnu/release/linkerd-tcp: $(RUST_TARBALL)
24+
docker pull $(DOCKER_IMAGE)
25+
@docker run \
26+
--rm -v $(shell pwd):/rust/app \
27+
-u root \
28+
-w /rust/app \
29+
--entrypoint=/bin/bash \
30+
$(DOCKER_IMAGE) \
31+
-exc "cd /tmp && \
32+
(gzip -dc /rust/app/$(RUST_TARBALL) | tar xf -) && \
33+
./rust-$(RUST_VERSION)-x86_64-unknown-linux-gnu/install.sh --without=rust-docs && \
34+
cd /rust/app && \
35+
cargo build --release --verbose --target=x86_64-unknown-linux-gnu"
36+
37+
clean:
38+
-rm -rf target
39+
40+
distclean: clean
41+
-rm -f $(RUST_TARBALL)

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ Try running the image with:
103103
docker run -v `pwd`/example.yml:/example.yml linkerd/linkerd-tcp:latest /example.yml
104104
```
105105

106+
To build linkerd/linkerd-tcp stand-alone binaries for Linux (requires docker), run:
107+
108+
```bash
109+
make linux
110+
```
111+
112+
To build linkerd/linkerd-tcp stand-alone binaries for macOS (requires macOS host), run:
113+
114+
```bash
115+
make darwin
116+
```
117+
106118
## Code of Conduct ##
107119

108120
This project is for everyone. We ask that our users and contributors take a few minutes to

0 commit comments

Comments
 (0)