https://docs.docker.com/mac/step_one/
$ docker-compose build
$ docker-compose up
- More info: docker-compose up
Should only have to do this whenever starting up the VM or dockerfile has changed.
4. Probably will have to set the docker port and host port to be the same so can boot up and access it locally:
- Open VirtualBox
- Open
Settings
- Open
Network
- Open
Port Forwarding
- Click
Add
icon - name:
rails
(or whatever), host port:3000
, guest port:3000
- Open
localhost:3000
in browser, should see the app working now!
$ docker-machine restart default
$ eval $(docker-machine env default)
- Open VirtualBox
- Turn off the "default" machine
- Run Docker Quickstart and it starts up the VM and connects fine!
- Launch Docker Quickstart
$ eval $(docker-machine env default)
- docker-compose up
- To run
rails console
:$ docker-compose run web rails console
- To see all the containers that are currently running:
$ docker ps