Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplest support of Windows with Docker #5

Closed
wants to merge 5 commits into from
Closed
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
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,29 @@ It has three display modes:

## Installation

Note: Currently viewprof doesn't support Windows because the underlying library (vty) doesn't support it yet. See [#1](https://github.com/maoe/viewprof/issues/1).

```
stack install viewprof
```

### On Windows

#### Prerequisites

- [Docker for Windows](https://docs.docker.com/docker-for-windows/install/) or [Docker Toolbox](https://docs.docker.com/toolbox/overview/).
- Currently tried with: [Docker Toolbox v17.04.0ce](https://github.com/docker/toolbox/releases/tag/v17.04.0-ce) on Windows 10 Home.
- [cygpath](https://cygwin.com/cygwin-ug-net/cygpath.html)
- Bundled with [Cygwin](https://www.cygwin.com/), [MSYS2](http://www.msys2.org/) etc.

#### How to install and launch

```bat
git clone git@github.com:maoe/viewprof.git
cd viewprof/docker
docker-machine start
docker build -t viewprof .
.\viewprof.bat path/to/file.prof
```

## Usage

| keys | action |
Expand Down
4 changes: 2 additions & 2 deletions docker/setup
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

DOCKER_DIR=$(realpath $(dirname "$0"))
cd "$(dirname "$0")"

docker build -f "$DOCKER_DIR/Dockerfile" -t viewprof .
docker build -t viewprof .
12 changes: 0 additions & 12 deletions docker/viewprof

This file was deleted.

7 changes: 7 additions & 0 deletions docker/viewprof.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo off

rem NOTE: This script assumes docker-machine.exe and cygpath are in the PATH!

for /f "usebackq delims=" %%e in (`docker-machine.exe env --shell cmd`) do %%e
for /f "usebackq delims=" %%v in (`cygpath %~f1`) do set viewprof_arg=%%v
docker run --rm -it -v %viewprof_arg%:/home/viewprof/%viewprof_arg% viewprof /home/viewprof%viewprof_arg%