Skip to content

Commit

Permalink
Merge pull request #1 from roboflow-ai/feature/docker-run-cli
Browse files Browse the repository at this point in the history
Added a Dockerfile and documentation for a Docker cli run
  • Loading branch information
hansent authored Nov 16, 2022
2 parents a91bee9 + 46bcb3d commit 45ba5b4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# syntax=docker/dockerfile:1
FROM node:16-alpine
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN npm i -g roboflow-cli
ENTRYPOINT ["roboflow"]
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,32 @@ or
```
roboflow detect -h
```

### Run the CLI in a docker container (alpha support)

If you don't want to install node, npm and other roboflow cli dependencies, but still use the roboflow cli you can run it in a docker container.

Assuming you have docker installed on your machine, first build the image

```
docker build -t roboflowcli:latest .
```

Then, run the roboflow cli docker image interactively like so



```
# Authorize
docker run -it -v ~/.config/roboflow:/root/.config/roboflow roboflowcli:latest roboflow auth
# Use the CLI as usual inside a docker container.
docker run -it -v ~/.config/roboflow:/root/.config/roboflow roboflowcli:latest roboflow project list
```

Here we have mounted the roboflow credentials into the docker container. The first docker command authorizes the user and stores credentials
in the user's `$HOME/.config/roboflow` directory. These credentials are then mounted onto the docker container in subsequent runs, as shown above.

You will similarly have to mount any data directories in case you are uploading images or annotations, for example.

0 comments on commit 45ba5b4

Please sign in to comment.