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

Commit 49bef00

Browse files
authored
Add dockerize script for building slim docker image (#20)
* Add dockerize script for building slim docker image * Use full path to executable
1 parent 94d6410 commit 49bef00

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
FROM jimmycuadra/rust:1.16.0
1+
FROM debian:jessie-slim
22

3-
RUN mkdir -p /rust/app
4-
WORKDIR /rust/app
5-
6-
ENV TARGET=x86_64-unknown-linux-gnu
7-
8-
COPY . /rust/app
9-
RUN cargo build --release --target=$TARGET
10-
RUN cp ./target/$TARGET/release/linkerd-tcp /usr/local/bin
3+
COPY ./target/x86_64-unknown-linux-gnu/release/linkerd-tcp /usr/local/bin/
114

125
ENTRYPOINT ["/usr/local/bin/linkerd-tcp"]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ debugging, set `RUST_LOG=trace`.
8989
To build the linkerd/linkerd-tcp docker image, run:
9090

9191
```bash
92-
docker build -t linkerd/linkerd-tcp:latest .
92+
./dockerize latest
9393
```
9494

95-
Replace the `latest` tag with the version that you want to build.
95+
Replace `latest` with the version that you want to build.
9696

9797
Try running the image with:
9898

dockerize

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ -z "$1" ]; then
6+
echo "usage: dockerize <tag>" >&2
7+
exit 1
8+
fi
9+
10+
docker run --rm -v `pwd`:/rust/app -w /rust/app jimmycuadra/rust:1.16.0 cargo build --release --target=x86_64-unknown-linux-gnu
11+
docker build -t linkerd/linkerd-tcp:$1 .
12+
13+
echo "Created linkerd/linkerd-tcp:$1"

0 commit comments

Comments
 (0)