Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
target
/rust-*.tar.gz
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
RUST_VERSION = 1.16.0
DOCKER_IMAGE = alexcrichton/rust-slave-dist:2015-10-20b
RUST_TARBALL = rust-$(RUST_VERSION)-x86_64-unknown-linux-gnu.tar.gz
RUST_SOURCE = https://static.rust-lang.org/dist/$(RUST_TARBALL)

ifeq ($(shell uname -s),Darwin)
all: linux darwin

darwin: target/x86_64-apple-darwin/release/linkerd-tcp

target/x86_64-apple-darwin/release/linkerd-tcp:
cargo build --release --verbose --target=x86_64-apple-darwin

else
all: linux
endif

linux: $(RUST_TARBALL) target/x86_64-unknown-linux-gnu/release/linkerd-tcp

$(RUST_TARBALL):
curl -L -o $(RUST_TARBALL) $(RUST_SOURCE)

target/x86_64-unknown-linux-gnu/release/linkerd-tcp: $(RUST_TARBALL)
docker pull $(DOCKER_IMAGE)
@docker run \
--rm -v $(shell pwd):/rust/app \
-u root \
-w /rust/app \
--entrypoint=/bin/bash \
$(DOCKER_IMAGE) \
-exc "cd /tmp && \
(gzip -dc /rust/app/$(RUST_TARBALL) | tar xf -) && \
./rust-$(RUST_VERSION)-x86_64-unknown-linux-gnu/install.sh --without=rust-docs && \
cd /rust/app && \
cargo build --release --verbose --target=x86_64-unknown-linux-gnu"

clean:
-rm -rf target

distclean: clean
-rm -f $(RUST_TARBALL)
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ Try running the image with:
docker run -v `pwd`/example.yml:/example.yml linkerd/linkerd-tcp:latest /example.yml
```

To build linkerd/linkerd-tcp stand-alone binaries for Linux (requires docker), run:

```bash
make linux
```

To build linkerd/linkerd-tcp stand-alone binaries for macOS (requires macOS host), run:

```bash
make darwin
```

## Code of Conduct ##

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