Skip to content

Instantly share code, notes, and snippets.

@rhoboro
Last active September 16, 2015 00:21
Show Gist options
  • Save rhoboro/98dbceab4c338600b152 to your computer and use it in GitHub Desktop.
Save rhoboro/98dbceab4c338600b152 to your computer and use it in GitHub Desktop.

Docker

  • ホストのポート80をコンテナの8080にポートフォワードしてコンテナを立ち上げる
docker run -p 80:8080 -p 50000:50000 jenkins
  • 稼働中コンテナでbashを立ち上げ、ログインする
docker exec -i -t [CONTAINER ID] /bin/bash

Docker-Machine

docker-machine create -d virtualbox dev-01
docker-machine create -d digitalocean --digitalocean-access-token $DO_APIKEY dev-02

Docker-Swarm

docker-machine create -d virtualbox swarm-token
eval "$(docker-machine env swarm-token)"
docker run swarm create
  >>> XXX
eval "$(docker-machine env swarm-token -u)"
docker-machine stop swarm-token
docker-machine rm swarm-token

Docker-Swarm

docker-machine create -d virtualbox --swarm --swarm-master --swarm-discovery token://XXX swarm-master
docker-machine create -d virtualbox --swarm --swarm-discovery token://XXX swarm-node-01
docker-machine create -d virtualbox --swarm --swarm-discovery token://XXX swarm-node-02
docker-machine create -d virtualbox --swarm --swarm-discovery token://XXX swarm-node-03
eval "$(docker-machine env --swarm swarm-master)"

DEMO: Rocket.Chat

docker run -v ~/rocketchat-mongodb:/data/db --name rocketchat-db mongo mongod --smallfiles
docker run --name rocketchat --link rocketchat-db:rocketchat -e MONGO_URL=mongodb://rocketchat-db:27017 -e ROOT_URL=http://[IPアドレス] -p 80:80 rocketchat/rocket.chat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment