Skip to content

Commit c8968a8

Browse files
committed
fix: adding docker-cli to the Dockerfile in order to support pytorch inspection from within a container
1 parent fc856ce commit c8968a8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

Dockerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ ADD . /app
77
RUN cargo build --release
88

99
FROM debian:bullseye
10-
RUN apt-get update && apt-get install -y libssl-dev ca-certificates
10+
11+
RUN apt-get update && apt-get install -y libssl-dev curl ca-certificates
12+
13+
RUN curl -fsSL https://get.docker.com | sh
14+
1115
COPY --from=builder /app/target/release/tman /usr/bin/tman
16+
1217
ENTRYPOINT ["/usr/bin/tman"]

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
2323
## Install with Cargo
2424

25+
This is the recommended way to install and use the tool:
26+
2527
```bash
2628
cargo install tensor-man
2729
```
@@ -40,6 +42,20 @@ To build your own Docker image for the tool, run:
4042
docker build . -t tman
4143
```
4244

45+
## Note about Docker
46+
47+
If you want to inspect PyTorch models and you are using `tensor-man` inside a container, make sure to share the docker socket from the host machine with the container:
48+
49+
```bash
50+
docker run -it \
51+
# these paths must match
52+
-v/path/to/pytorch_model.bin:/path/to/pytorch_model.bin \
53+
# allow the container itself to instrument docker on the host
54+
-v/var/run/docker.sock:/var/run/docker.sock \
55+
# the rest of the command line
56+
tman inspect /path/to/pytorch_model.bin
57+
```
58+
4359
## Build from source
4460

4561
Alternatively you can build the project from source, in which case you'll need to have Rust and Cargo [installed on your system](https://rustup.rs/).

0 commit comments

Comments
 (0)