Skip to content

Commit

Permalink
Simplify stack --docker commands by specifying the image in stack.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
Bart Schuurmans authored and fkm3 committed Jan 20, 2023
1 parent b5e3a98 commit ded944f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,17 @@ working, the following commands will compile and run the tests.
```
git clone --recursive https://github.com/tensorflow/haskell.git tensorflow-haskell
cd tensorflow-haskell
IMAGE_NAME=tensorflow/haskell:2.3.0
docker build -t $IMAGE_NAME docker
docker build -t tensorflow/haskell:2.3.0 docker
# TODO: move the setup step to the docker script.
stack --docker --docker-image=$IMAGE_NAME setup
stack --docker --docker-image=$IMAGE_NAME test
stack --docker setup
stack --docker test
```

There is also a demo application:

```
cd tensorflow-mnist
stack --docker --docker-image=$IMAGE_NAME build --exec Main
stack --docker build --exec Main
```

### Stack + Docker + GPU
Expand All @@ -93,6 +92,9 @@ If you want to use GPU you can do:
```
IMAGE_NAME=tensorflow/haskell:2.3.0-gpu
docker build -t $IMAGE_NAME docker/gpu
# TODO: move the setup step to the docker script.
stack --docker --docker-image=$IMAGE_NAME setup
stack --docker --docker-image=$IMAGE_NAME test
```

### Using nvidia-docker version 2
Expand Down
4 changes: 4 additions & 0 deletions stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ extra-lib-dirs:
extra-include-dirs:
- /usr/local/include

docker:
enable: false
image: tensorflow/haskell:2.3.0

nix:
enable: false
# nixos-21.05 with libtensorflow 2.3.0
Expand Down

0 comments on commit ded944f

Please sign in to comment.