github.com/mika/distribution@v2.2.2-0.20160108133430-a75790e3d8e0+incompatible/docs/osx-setup-guide.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "Running on OS X"
     4  description = "Explains how to run a registry on OS X"
     5  keywords = ["registry, on-prem, images, tags, repository, distribution, OS X, recipe, advanced"]
     6  +++
     7  <![end-metadata]-->
     8  
     9  # OS X Setup Guide
    10  
    11  ## Use-case
    12  
    13  This is useful if you intend to run a registry server natively on OS X.
    14  
    15  ### Alternatives
    16  
    17  You can start a VM on OS X, and deploy your registry normally as a container using Docker inside that VM.
    18  
    19  The simplest road to get there is traditionally to use the [docker Toolbox](https://www.docker.com/toolbox), or [docker-machine](https://docs.docker.com/machine/), which usually relies on the [boot2docker](http://boot2docker.io/) iso inside a VirtualBox VM.
    20  
    21  ### Solution
    22  
    23  Using the method described here, you install and compile your own from the git repository and run it as an OS X agent.
    24  
    25  ### Gotchas
    26  
    27  Production services operation on OS X is out of scope of this document. Be sure you understand well these aspects before considering going to production with this.
    28  
    29  ## Setup golang on your machine
    30  
    31  If you know, safely skip to the next section.
    32  
    33  If you don't, the TLDR is:
    34  
    35      bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
    36      source ~/.gvm/scripts/gvm
    37      gvm install go1.4.2
    38      gvm use go1.4.2
    39  
    40  If you want to understand, you should read [How to Write Go Code](https://golang.org/doc/code.html).
    41  
    42  ## Checkout the Docker Distribution source tree
    43  
    44      mkdir -p $GOPATH/src/github.com/docker
    45      git clone https://github.com/docker/distribution.git $GOPATH/src/github.com/docker/distribution
    46      cd $GOPATH/src/github.com/docker/distribution
    47  
    48  ## Build the binary
    49  
    50      GOPATH=$(PWD)/Godeps/_workspace:$GOPATH make binaries
    51      sudo cp bin/registry /usr/local/libexec/registry
    52  
    53  ## Setup
    54  
    55  Copy the registry configuration file in place:
    56  
    57      mkdir /Users/Shared/Registry
    58      cp docs/osx/config.yml /Users/Shared/Registry/config.yml
    59  
    60  ## Running the Docker Registry under launchd
    61  
    62  Copy the Docker registry plist into place:
    63  
    64      plutil -lint docs/osx/com.docker.registry.plist
    65      cp docs/osx/com.docker.registry.plist ~/Library/LaunchAgents/
    66      chmod 644 ~/Library/LaunchAgents/com.docker.registry.plist
    67  
    68  Start the Docker registry:
    69  
    70      launchctl load ~/Library/LaunchAgents/com.docker.registry.plist
    71  
    72  ### Restarting the docker registry service
    73  
    74      launchctl stop com.docker.registry
    75      launchctl start com.docker.registry
    76  
    77  ### Unloading the docker registry service
    78  
    79      launchctl unload ~/Library/LaunchAgents/com.docker.registry.plist