tombh / peas

Docker and Ruby based PaaS
GNU General Public License v2.0
601 stars 33 forks source link

[WIP] OS X install support #25

Closed danbartlett closed 9 years ago

danbartlett commented 9 years ago
danbartlett commented 9 years ago

So here are the steps, post-installation of boot2docker through pcapt, that are required to get docker ready to run. I've included output as it may be relevant to the bootstrap/run process as a a whole:

$ boot2docker init
Latest release for boot2docker/boot2docker is v1.3.2
Downloading boot2docker ISO image...
Success: downloaded https://github.com/boot2docker/boot2docker/releases/download/v1.3.2/boot2docker.iso
    to /Users/danbartlett/.boot2docker/boot2docker.iso
Generating public/private rsa key pair.
Your identification has been saved in /Users/danbartlett/.ssh/id_boot2docker.
Your public key has been saved in /Users/danbartlett/.ssh/id_boot2docker.pub.
The key fingerprint is:
fc:d1:ec:54:6a:e4:91:04:ad:9b:f1:ca:d5:f2:87:a9 danbartlett@Dans-MBP.lan
The key's randomart image is:
+--[ RSA 2048]----+
|          .o.    |
|           ...   |
|           .+ .  |
|       .  o= +   |
|        S .=B.   |
|         .o=+ .  |
|         ..o.o o |
|          o   + .|
|            E. . |
+-----------------+

Then:

$ boot2docker start
Waiting for VM and Docker daemon to start...
....................ooooooooooooooooooooo
Started.
Writing /Users/danbartlett/.boot2docker/certs/boot2docker-vm/ca.pem
Writing /Users/danbartlett/.boot2docker/certs/boot2docker-vm/cert.pem
Writing /Users/danbartlett/.boot2docker/certs/boot2docker-vm/key.pem

To connect the Docker client to the Docker daemon, please set:
    export DOCKER_HOST=tcp://192.168.59.103:2376
    export DOCKER_CERT_PATH=/Users/danbartlett/.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1

So then I just ran the export's then and there, but I'm guessing these vars will need to be set on boot in .bashrc or something. This finally gave me some response from docker ps -a:

$ docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES

Then I ran run.sh, which took about 10 minutes to complete, ending with..

It was installed into /home/peas/.bundler
Running Peas in development environment
09:51:35 api.1         | started with pid 3165
09:51:35 switchboard.1 | started with pid 3166
09:51:35 gardener.1    | started with pid 3169
root@094530208aaf:/#

:tada: :balloon:

So, those extra commands:

Do you think they should be run in bootstrap.sh or run.sh? I don't know the other use cases for those files yet. Also, do you recommend chucking the variables in some bash config files? After those things are added I'll try running bootstrap.sh from scratch, and then restarting my laptop to figure out whether all the set up is persisted on each boot.

tombh commented 9 years ago

I think this is also going to need a change to the README. bootstrap.sh is really more for setting up live nodes of Peas on VPSs. But it'd certainly be good it if Just Works™ for OSX too. If those extra commands work in bootstrap.sh without much fuss then go for it. I'd just worry if the code for setting up OSX was longer than the code for setting up all the other Linuxes.

danbartlett commented 9 years ago

Yeah I see what you mean. I'll add the other commands in and see how it looks, then we can judge whether or not it's just better to enhance the README

danbartlett commented 9 years ago

Had a few more attempts at this, but got all kinds of errors and I'm not comfortable enough with docker and boot2docker to figure out what's going on... May just be worth updating the README!

time="2015-01-14T21:00:34Z" level="fatal" msg="Get http:///var/run/docker.sock/v1.16/containers/json?all=1: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?"
Creating data container...
FATA[0000] Post http:///var/run/docker.sock/v1.16/containers/create?name=peas-data: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
tombh commented 9 years ago

Hmm, okay, well updated the README for now