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 3 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: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,31 @@ 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).
For Windows users, see below.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's drop this sentence. The following instruction is short.


```
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

```bash
Copy link
Owner

@maoe maoe May 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use bat or something instead? Or is it actually bash?

$ git clone git@github.com:maoe/viewprof.git
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please drop the $-signs to make the instructions copy-paste friendly.

$ cd viewprof/docker
$ docker-machine start
$ docker build -t viewprof .
$ .\viewprof.bat path/to/file.prof
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Windows accept forward slash delimiters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, actually whichever will do.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good to know.

```

## 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%