Skip to content
This repository was archived by the owner on Jun 12, 2018. It is now read-only.

Commit c394102

Browse files
committed
docs: Update documentation to reflect latest changes and document how to install the CLI on OSX
1 parent 13e218f commit c394102

5 files changed

Lines changed: 58 additions & 42 deletions

File tree

docs/buildpacks/golang.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,24 @@ If a `Godep` dir is found, this buildpack will download and install [godep](http
99
into your `$PATH` and will parse the `GoVersion` and `ImportPath` attributes
1010
when setting things up.
1111

12-
Since currently devstep [does not support](https://github.com/fgrehm/devstep/issues/51)
13-
setting the workspace directory used inside the container, this buildpack will
14-
attempt to parse your project's import path for you using the following approach:
12+
This buildpack will attempt to identify your project's import path for you using
13+
the following priority:
1514

1615
1. `ImportPath` from Godep configs
1716
2. `.godir` file
1817
3. Remote github repository URL
1918
4. `GO_PROJECT_NAME` environmental variable
2019

2120
After identifying the import path, the buildpack will symlink your project sources
22-
into the appropriate path under the `$GOPATH/src` dir.
21+
into the appropriate path under the `$GOPATH/src` dir. You can also configure
22+
the `working_dir` to an appropriate path on your [project's `devstep.yml`](cli/configuration):
2323

24-
If godep is configured, the buildpack will attempt a `godep go build` for you,
24+
```yml
25+
# The directory where project sources should be mounted inside the container.
26+
working_dir: '/home/devstep/gocode/src/github.com/fgrehm/devstep-cli'
27+
```
28+
29+
If godep is configured, the buildpack will attempt a `godep go install` for you,
2530
otherwise it will download project's dependencies with `go get` so you can
2631
start hacking right away.
2732

docs/cli/commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
1. [Hack](#user-content-hack)
55
1. [Build](#user-content-build)
6-
1. [Boostrap](#user-content-bootstrap)
6+
1. [Bootstrap](#user-content-bootstrap)
77
1. [Other commands](#user-content-other-commands)
88

99
--------------

docs/cli/installation.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,43 @@
11
# CLI Installation
22
------------------
33

4-
The CLI is [written in Golang](https://github.com/fgrehm/devstep-cli) and precompiled
5-
binaries are available for each GitHub tagged release. Installing it is a matter
6-
of downloading it from GitHub, placing the binary on a directory available on your
7-
`PATH` and making it executable.
8-
9-
This one liner can handle it for you assuming that `$HOME/bin` is available
10-
on your `PATH`:
4+
Precompiled binaries are available for each GitHub tagged release:
115

126
```sh
7+
# On Linux (assumes `$HOME/bin` is on your `PATH`)
138
L=$HOME/bin/devstep && curl -sL https://github.com/fgrehm/devstep-cli/releases/download/v1.0.0/linux_amd64 > $L && chmod +x $L
9+
10+
# On OSX
11+
brew tap fgrehm/devstep
12+
brew install devstep
1413
```
1514

16-
Please note that the CLI is currently limited to connecting to a local `/var/run/docker.sock`
15+
Please note that the CLI currently defaults to connecting to a local `/var/run/docker.sock`
1716
socket only and the user that runs `devstep` commands will need [non-root access to it](http://docs.docker.io/installation/ubuntulinux/#giving-non-root-access).
18-
Support for execution over TCP is likely to be added at some point.
19-
17+
On OSX we rely on the environmental variables set by `docker-machine` (like
18+
`DOCKER_HOST` and `DOCKER_CERT_PATH` for example) and also on the fact that the
19+
`$HOME` dir is automagically shared with the VM that runs the docker daemon.
2020

2121
> **IMPORTANT**: A `developer` user will be used by Devstep and it assumes your
22-
user and group ids are equal to `1000` when using the CLI or the container's init
23-
process will be aborted. This is to guarantee that files created within Docker
24-
containers have the appropriate permissions so that you can manipulate them
25-
on the host without the need to use `sudo`. This is currently a Devstep limitation
26-
that will be worked around in case there is enough demand or will be fixed once
27-
Docker adds support for user namespaces.
22+
user and group ids are equal to `1000` when using the CLI. This is to guarantee
23+
that files created within Docker containers have the appropriate permissions so
24+
that you can manipulate them on the host without the need to use `sudo`. This is
25+
currently a Devstep limitation that will be handled on a future release.
2826

2927
> The `1000` id was chosen because it is the default uid / gid of Ubuntu Desktop users
3028
that are created during the installation process. To work around this limitation
3129
you can build your own image with the appropriate ids and add a `source_image: '<YOUR-IMAGE>:<OPTIONAL-TAG>'`
3230
line to your `~/devstep.yml` so that the image is used as a source for your projects.
3331

32+
> When on OSX using dinghy, this should not be a problem thanks to how it sets up
33+
NFS shares.
34+
3435
## Bash autocomplete
3536

36-
An autocompletion script can be installed using the one liner below:
37+
An autocompletion script for Linux can be installed using the one liner below:
3738

3839
```sh
3940
curl -sL https://github.com/codegangsta/cli/raw/master/autocomplete/bash_autocomplete | sed 's/$PROG/devstep/' | sudo tee /etc/bash_completion.d/devstep
4041
```
42+
43+
On OSX it gets installed automatically thanks to Homebrew.

docs/getting-started.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,53 @@ will download that image as needed when using `Dockerfile`s but the Devstep CLI
1212
---------------
1313

1414
This project is being developed and tested on an Ubuntu 14.04 host with Docker
15-
1.7.0, while it is likely to work on other distros / Docker versions /
16-
[boot2docker](http://boot2docker.io/), I'm not sure how it will behave on the wild.
15+
1.9.0+ and on OSX using [dinghy VMs](https://github.com/codekitchen/dinghy) powered
16+
by the [xhyve docker-machine driver](https://github.com/zchee/docker-machine-driver-xhyve).
17+
While it is likely to work on other distros / Docker versions / boot2docker setups,
18+
I'm not sure how it will behave on the wild.
1719

18-
Please note that the CLI is currently limited to connecting to a local `/var/run/docker.sock`
20+
Please note that the CLI currently defaults to connecting to a local `/var/run/docker.sock`
1921
socket only and the user that runs `devstep` commands will need [non-root access to it](http://docs.docker.io/installation/ubuntulinux/#giving-non-root-access).
20-
Support for execution over TCP is likely to be added at some point in the future.
22+
On OSX we rely on the environmental variables set by `docker-machine` (like
23+
`DOCKER_HOST` and `DOCKER_CERT_PATH` for example) and also on the fact that the
24+
`$HOME` dir is automagically shared with the VM that runs the docker daemon.
2125

2226
## Getting started with the CLI
2327
-------------------------------
2428

2529
> **IMPORTANT**: A `developer` user will be used by Devstep and it assumes your
26-
user and group ids are equal to `1000` when using the CLI or the container's init
27-
process will be aborted. This is to guarantee that files created within Docker
28-
containers have the appropriate permissions so that you can manipulate them
29-
on the host without the need to use `sudo`. This is currently a Devstep limitation
30-
that will be worked around in case there is enough demand or will be fixed once
31-
Docker adds support for user namespaces.
30+
user and group ids are equal to `1000` when using the CLI. This is to guarantee
31+
that files created within Docker containers have the appropriate permissions so
32+
that you can manipulate them on the host without the need to use `sudo`. This is
33+
currently a Devstep limitation that will be handled on a future release.
3234

3335
> The `1000` id was chosen because it is the default uid / gid of Ubuntu Desktop users
3436
that are created during the installation process. To work around this limitation
3537
you can build your own image with the appropriate ids and add a `source_image: '<YOUR-IMAGE>:<OPTIONAL-TAG>'`
3638
line to your `~/devstep.yml` so that the image is used as a source for your projects.
3739

38-
To install the CLI, you can run the one liner below and read on for more:
40+
> When on OSX using dinghy, this should not be a problem thanks to how it sets up
41+
NFS shares.
42+
43+
To install the CLI:
3944

4045
```sh
46+
# On Linux (assumes `$HOME/bin` is on your `PATH`)
4147
L=$HOME/bin/devstep && curl -sL https://github.com/fgrehm/devstep-cli/releases/download/v1.0.0/linux_amd64 > $L && chmod +x $L
42-
```
4348

44-
_The snippet above assumes `$HOME/bin` is on your `PATH`, change `$HOME/bin` to
45-
an appropriate path in case your system is not configured like that._
49+
# On OSX
50+
brew tap fgrehm/devstep
51+
brew install devstep
52+
```
4653

4754
### Doing a quick hack on a project
4855

4956
With the CLI and Docker in place, just `cd` into your project and run `devstep hack`,
5057
it should be all you need to start working on your project. Devstep will create
5158
a Docker container, will install your project dependencies in it and at the end
5259
you'll be dropped on a `bash` session inside the container with project sources
53-
available at `/workspace`.
60+
available at `/workspace`. **Don't forget to `eval $(docker-machine env <vm-name>)` /
61+
`eval $(dinghy env)` in case you are on OSX.**
5462

5563
From inside the container, you can do your work as you would on your own machine.
5664
For example, you can use `rake test` to run your Ruby tests or `go build` to
@@ -84,8 +92,8 @@ devstep hack -p 8080:8080
8492
```
8593

8694
And it will redirect the `8080` port on your host to the `8080` port within the
87-
container so you can just hit `http://localhost:8080` on your browser to see your
88-
app running after it is up.
95+
container so you can just hit `http://localhost:8080` (or `http://DOCKER_HOST:8080`)
96+
on your browser to see your app running after it is up.
8997

9098
### Using databases or other services from within containers
9199

docs/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Heroku apps) will be available for `fgrehm/devstep` environments.
5252
On top of `heroku/cedar:14`, we:
5353

5454
* Create a `developer` user to avoid using `root` and creating files with wrong permissions during development.
55-
* Install some extra devel packages (like `libyaml-dev`) and other "nice to have"
56-
packages and utilities (like `tmux` and `vim`).
55+
* Install some extra devel packages (like `libreadline`) and other "nice to have"
56+
packages and utilities (like `vim` and `sqlite3`).
5757
* Configure PostgreSQL and MySQL clients.
5858
* Set the image `ENTRYPOINT` to our own init system and the default command to a `bash` login shell.
5959
* Configure a couple of startup scripts (like automatic port forwading to linked containers).

0 commit comments

Comments
 (0)