Skip to content

Commit ddf0f80

Browse files
author
Jesse Seldess
committed
added os x build for source instructions
1 parent 6989fbb commit ddf0f80

File tree

5 files changed

+67
-48
lines changed

5 files changed

+67
-48
lines changed

.DS_Store

0 Bytes
Binary file not shown.

_get_started/2_run_on_osx.md

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,63 @@
22
title: Run on OS X
33
---
44

5-
There are four ways to install and run CockroachDB on OS X for local development and testing:
5+
There are currently two ways to deploy CockroachDB locally on OSX:
66

77
- [Download the Binary](#download-the-binary)
8-
- [Use Docker](#use-docker)
9-
- [Use Homebrew](#use-homebrew)
108
- [Build from Source](#build-from-source)
119

1210
## Download the Binary
1311

14-
## Use Docker
15-
16-
Docker provides an official CockroachDB image.
1712

18-
1. **Install Docker**
19-
For a quick Docker install, run the following commands in your system shell. See [Docker's official documentation](https://docs.docker.com/engine/installation/mac/) for full installation instructions.
13+
## Build from Source
2014

21-
```bash
15+
1. Install the following prerequisites, as necessary:
16+
- A C++ compiler that supports C++11 (GCC 4.9+ and clang 3.6+ are known to work). On Mac OS X, Xcode should suffice.
17+
- A [Go environment](http://golang.org/doc/code.html) with a 64-bit version of Go 1.5. You can download the [Go binary](https://golang.org/dl/) directly from the official site. On OS X, you can also use [homebrew](http://brew.sh): `brew install go`.
18+
- Git 1.8+
2219

23-
# Install docker and docker-machine:
24-
$ brew install docker docker-machine
20+
2. Get the CockroachDB code:
2521

26-
# Install VirtualBox:
27-
$ brew cask install virtualbox
22+
```bash
23+
$ go get -d github.com/cockroachdb/cockroach
24+
```
2825

29-
# Create and start the virtual machine:
30-
$ docker-machine create --driver virtualbox default
26+
3. Compile the CockroachDB binary:
3127

32-
# Set up the environment for the docker client:
33-
$ eval $(docker-machine env default)
28+
```bash
29+
$ cd $GOPATH/src/github.com/cockroachdb/cockroach
30+
$ make build
3431
```
3532

36-
2. **Pull the CockroachDB image**
33+
The first time you run `make`, it can take some time to download and install various dependencies.
34+
35+
4. Start up a cluster:
3736

3837
```bash
39-
$ docker pull cockroachdb/cockroach
38+
$ ./cockroach start --dev &
4039
```
4140

42-
3. **Start up the Cockroach shell**
41+
## Use Docker
42+
43+
Deploying CockroachDB in Docker is quick and easy. Once you've installed Docker, just run Cockroach in the default Docker container.
44+
45+
1. [Install Docker](https://docs.docker.com/mac/step_one/), as described in Docker's installation instructions for OS X.
46+
47+
2. To start CockroachDB, run this command in your terminal:
4348

4449
```bash
4550
$ docker run -t -i cockroachdb/cockroach shell
46-
# root@82cb657cdc42:/cockroach#
4751
```
4852

53+
The first time you do this, Docker pulls the official CockroachDB image from Docker Hub. From that point on, the image remains on your local system. You can run `docker images` to list all of your local images.
4954

50-
## Build from Source
55+
```bash
56+
$ docker images
5157
58+
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
59+
cockroachdb/cockroach latest e707dfaf8703 2 days ago 278.2 MB
60+
hello-world latest 0a6ba66e537a 9 weeks ago 960 B
61+
```
5262

5363
Random code sample:
5464

_site/atom/index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<title>CockroachDB Docs</title>
44
<link href="http://docs.cockroachlabs.com/atom.xml" rel="self" />
55
<link href="http://docs.cockroachlabs.com/"/>
6-
<updated>2015-12-16T22:04:38-05:00</updated>
6+
<updated>2015-12-17T18:00:31-05:00</updated>
77
<id>http://docs.cockroachlabs.com</id>
88
<author>
99
<name>Jesse</name>

_site/docs/atom/index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<title>CockroachDB Docs</title>
44
<link href="http://docs.cockroachlabs.com/atom.xml" rel="self" />
55
<link href="http://docs.cockroachlabs.com/"/>
6-
<updated>2015-12-16T22:04:38-05:00</updated>
6+
<updated>2015-12-17T18:00:31-05:00</updated>
77
<id>http://docs.cockroachlabs.com</id>
88
<author>
99
<name>Jesse</name>

_site/get_started/run-on-os-x/index.html

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -356,47 +356,56 @@ <h3>Get Started</h3>
356356
</div>
357357
<article class="content">
358358

359-
<p>There are four ways to install and run CockroachDB on OS X for local development and testing:</p>
359+
<p>There are currently two ways to deploy CockroachDB locally on OSX:</p>
360360

361361
<ul>
362362
<li> <a href="#download-the-binary">Download the Binary</a></li>
363-
<li> <a href="#use-docker">Use Docker</a></li>
364-
<li> <a href="#use-homebrew">Use Homebrew</a></li>
365363
<li> <a href="#build-from-source">Build from Source</a></li>
366364
</ul>
367365

368366
<h2 id="download-the-binary">Download the Binary</h2>
369367

370-
<h2 id="use-docker">Use Docker</h2>
371-
372-
<p>Docker provides an official CockroachDB image. </p>
368+
<h2 id="build-from-source">Build from Source</h2>
373369

374370
<ol>
375-
<li><p><strong>Install Docker</strong><br>
376-
For a quick Docker install, run the following commands in your system shell. See <a href="https://docs.docker.com/engine/installation/mac/">Docker&#39;s official documentation</a> for full installation instructions. </p>
377-
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="c"># Install docker and docker-machine: </span>
378-
<span class="nv">$ </span>brew install docker docker-machine
379-
380-
<span class="c"># Install VirtualBox: </span>
381-
<span class="nv">$ </span>brew cask install virtualbox
371+
<li><p>Install the following prerequisites, as necessary:</p>
382372

383-
<span class="c"># Create and start the virtual machine: </span>
384-
<span class="nv">$ </span>docker-machine create --driver virtualbox default
385-
386-
<span class="c"># Set up the environment for the docker client: </span>
387-
<span class="nv">$ </span><span class="nb">eval</span> <span class="k">$(</span>docker-machine env default<span class="k">)</span>
373+
<ul>
374+
<li> A working C++ compiler that supports C++11</li>
375+
<li> A 64-bit version of Go (download from https://golang.org/dl/ or run brew install go --cross-compile-common)</li>
376+
<li> Git 1.8+ and Mercurial</li>
377+
</ul></li>
378+
<li><p>Get the CockroachDB code from your Go workspace (directory specified in your <code>GOPATH</code> environment variable):</p>
379+
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>go get -d github.com/cockroachdb/cockroach
388380
</code></pre></div></li>
389-
<li><p><strong>Pull the CockroachDB image</strong> </p>
390-
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>docker pull cockroachdb/cockroach
381+
<li><p>Compile the CockroachDB binary:</p>
382+
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span><span class="nb">cd </span>cockroach
383+
<span class="nv">$ </span>make build
384+
</code></pre></div>
385+
<p>The first time you run <code>make</code>, it can take some time to download and install various dependent libraries and tools.</p></li>
386+
<li><p>Start up a cluster:</p>
387+
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>./cockroach start --dev <span class="p">&amp;</span>
391388
</code></pre></div></li>
392-
<li><p><strong>Start up the Cockroach shell</strong></p>
389+
</ol>
390+
391+
<h2 id="use-docker">Use Docker</h2>
392+
393+
<p>Deploying CockroachDB in Docker is quick and easy. Once you&#39;ve installed Docker, just run Cockroach in the default Docker container. </p>
394+
395+
<ol>
396+
<li><p><a href="https://docs.docker.com/mac/step_one/">Install Docker</a>, as described in Docker&#39;s installation instructions for OS X. </p></li>
397+
<li><p>To start CockroachDB, run this command in your terminal:</p>
393398
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>docker run -t -i cockroachdb/cockroach shell
394-
<span class="c"># root@82cb657cdc42:/cockroach#</span>
399+
</code></pre></div>
400+
<p>The first time you do this, Docker pulls the official CockroachDB image from Docker Hub. From that point on, the image remains on your local system. You can run <code>docker images</code> to list all of your local images.</p>
401+
<div class="highlight"><pre><code class="language-bash" data-lang="bash"><span class="nv">$ </span>docker images
402+
403+
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
404+
cockroachdb/cockroach latest e707dfaf8703 <span class="m">2</span> days ago 278.2 MB
405+
hello-world latest 0a6ba66e537a <span class="m">9</span> weeks ago <span class="m">960</span> B
395406
</code></pre></div></li>
396407
</ol>
397408

398-
<h2 id="build-from-source">Build from Source</h2>
399-
400409
<p>Random code sample:</p>
401410

402411
<div class="highlight"><pre><code class="language-python" data-lang="python"><span class="k">print</span><span class="p">(</span><span class="s">&#39;Welcome to the Pig Latin Translator!&#39;</span><span class="p">)</span>

0 commit comments

Comments
 (0)