SyntaxHighlighter

Showing posts with label Docker. Show all posts
Showing posts with label Docker. Show all posts

Monday, March 13, 2017

Using the Docker Embedded DNS

this is an easy way I just discovered and am noting it here so I don't forget.

to leverage docker's embedded dns, you can setup a custom network and then each container can resolve to each other via the 'name' attribute.

for example;

1. docker network create internaldns
2. docker run --name rmq -p 15672:15672 --net=internaldns -d rabbitmq:management
3. docker run --name httpcontainer -p 8080:8080 --net=internaldns -d scbs/http-rmq

this gives you;
- ability to connect to the host network via bridge
- ability to have httpcontainer look up the rabbitmq container using the dns entry 'rmq'

i love weave.works and think weave net is particularly awesome, but if you're just doing dns lookup on 1 docker host, this seems pretty light and easy

Wednesday, November 23, 2016

Docker on Ubuntu: http:///var/run/docker.sock/v1.18/containers/json: dial unix /var/run/docker.sock: permission denied

after installing 1.12.3 on Ubuntu 16.04, the permission denied issue came up.  after trying the docker group settings without any luck, the only thing left was to actually chmod the socket.

chmod 777 /var/run/docker.sock

and everything works

probably not the wisest thing to do and you can try chmod'ing with more restrictions, but after hours of google and frustration, it works.

Saturday, October 22, 2016

Jenkins on Docker - Admin Password

try this from the comments on hub.docker.com --> full credit to sidmalani

docker exec -it jenkins_test cat /var/jenkins_home/secrets/initialAdminPassword

Monday, October 17, 2016

Monday, January 25, 2016

Eclipse Che and Spring Boot

Eclipse Che and Spring Boot


so, in playing around with Spring Boot on Eclipse Che,  here's a couple points;
  • when using the spring-boot-maven-plugin, you can run mvn spring-boot:run from the browser IDE
  • to view the application, use the link given from the docker app, but remove the app-name (so http://[your-ip]:[port-mapped-to-spring-boot]/[maven-name], should actually be http://[your-ip]:[port-mapped-to-spring-boot]/ )

Eclipse Che - Some Startup Notes

Eclipse Che - Some Startup Notes

so Eclipse Che is a really cool idea to create "cloud-based" workspaces and a browser based IDE.  It uses docker as a corner stone to the development lifecycle for workspaces and, in initial playing around, is pretty cool.

Some quick notes
  • don't try and run it under root - create a new user, make sure they're a part of the docker group, and you're good
  • doesn't "look" nice in safari (there's a couple challenges with fonts and css sheets)
  • be patient with the workspace kick off, it pulls a docker image and that can take time - good candidate for "cacheing" on you server
  • when creating a Java class, create it as a full package resolution (so not "MyClass" but "io.example.MyClass" otherwise it will give you errors
Some links that helped

Sunday, January 24, 2016

Apache Geode (GemFire) in a Docker container

Apache Geode (GemFire) in a Docker container


If you want to play around with geode in docker, try this...

docker run -it apache geode/geode:1.0.0-incubating.M1.RC1 gosh


Sunday, January 17, 2016

weave + marathon - network

weave + marathon - network

quick note, if you're using weave on marathon with docker, make sure NETWORK is set to BRIDGE ("network":"bridge")


Friday, January 15, 2016

mesos + marathon + docker - installing via the packages

mesos + marathon + docker - installing via the packages

a little trick to installing via the packages; if you follow https://open.mesosphere.com/getting-started/install/, make sure you either proceed to the next steps and docker stuff, or add the following to /usr/lib/systemd/system/mesos-slave.service (centos 7)

Environment=MESOS_CONTAINERIZERS=docker,mess

under the [Service] bracket.

without these steps, mesos won't know how to call docker to start the marathon submitted docker jobs.

(a key indicator of this problem is...)

failed to start: None of the enabled containerizers (mesos) could create a container for the provided TaskInfo/ExecutorInfo message

Sunday, January 3, 2016

docker on centos 7 and "cgroupsfs" error

docker on centos 7 and "cgroupsfs" error


here's a workaround on centos 7 for that very annoying "[8] System error: open /sys/fs/cgroup..." error...

Random "Cannot start container" Errors on 1.9.0-rc5 CentOS7


Monday, December 21, 2015

trick for marathon for running docker + weave

weave DNS trick

a little trick with weave and marathon is the specification of the hostname.  unlike raw docker+weave, the hostname in weave DNS can be picked up by --name or --hostname.  But with the marathon json, hostname must have .weave.local as a suffix.  so, to deploy postgres via marathon and give it a weave DNS entry of postgres-server, the entry needs to be postures-server.weave.local


Tuesday, December 15, 2015

mesos + marathon + docker + weave

mesos + marathon + docker + weave

so here's a little configuration set of links for standing up a PaaS leveraging mesos, marathon, docker and weave (am using centos 7 on a VM);

  1. follow the install of the base platform here --> https://open.mesosphere.com/getting-started/install/
  2. install docker from here --> https://docs.docker.com/engine/installation/centos/
  3. use this weave script from here --> https://github.com/weaveworks/guides/blob/master/mesos-marathon/centos/weave
  4. use these service scripts in here --> https://github.com/weaveworks/guides/tree/master/mesos-marathon/centos
  5. but most importantly, add the following to /usr/lib/systemd/system/mesos-slave.service
Environment=MESOS_CONTAINERIZERS=docker,mesos
Environment=MESOS_DOCKER_SOCKET=/var/run/weave/weave.sock

now you can deploy normally with marathon and have your containers picked up in weave (and mapped)

Sunday, August 23, 2015

Kafka on Docker on Photon with AppCatalyst

Kafka on Docker on Photon with AppCatalyst

so, something to note with AppCatalyst; the Photon VMs are very small (memory-wise).  as such, spooling up some containers, like spotify/kafka, won't start.  so here's a simple one;

sudo docker run -d --name other_kafka -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=localhost --env ADVERTISED_PORT=9092 --env KAFKA_HEAP_OPTS="-Xmx256M -Xms128M" spotify/kafka

the memory settings help get it off the ground on appcatalyst-photon.

(which kind of goes against the 12 factor grain of "close-to-production" as possible given the docker script is altered to fit the VM...)


Tuesday, July 28, 2015

docker & weave & photon

Putting Docker, Weave and Photon together


  1. appcatalyst vm create [your vm name]
  2. appcatalyst vmpower on [your vm name]
  3. (wait... 10 seconds or so)
  4. appcatalyst guest getip [your vm name]
  5. ssh -i /opt/vmware/appcatalyst/etc/appcatalyst_insecure_ssh_key photon@[ip_address]
now you're in the VM, let's get weave

  1. sudo curl -L git.io/weave -O /usr/local/bin/weave
  2. sudo chmod a+x /usr/local/bin/weave
  3. sudo -s
  4. /usr/local/bin/weave launch
  5. /usr/local/bin/weave launch-dns
  6. /usr/local/bin/weave launch-proxy
  7. eval $(/usr/local/bin/weave proxy-env)
now you can run docker commands have weave play "nice" (dynamic mapping of --name to weaveDNS, etc.)


VMware appcatalyst

VMware appcatalyst - what is it and what could it mean to DevOps

VMware appcatalyst is a free, open source, non-UI VM host for Mac OS X.  It could be thought of a thin version of Fusion (no windows hosting, etc.)  a couple neat features of it include;

  • faster boot time
  • comes with a RESTful API (appcatalyst-daemon)
  • comes with Project Photon out of the box
a quick idea of how to start it

  1. appcatalyst vm create [give the VM a name]
  2. appcatalyst vmpower on [your VM name]
  3. (wait while it starts up... may be 10 seconds?)
  4. appcatalyst guest getip [your VM name]
  5. ssh -i /opt/vmware/appcatalyst/etc/appcatalyst_insecure_ssh_key photon@[ip_address]
once you're in, docker is already running
  • docker ps
and you can start playing with docker however you like.  (if you want to enable remote docker access, check out this)


From a DevOps point of view, appcatalyst - on a Mac, at least - opens up the possibility of the following;
  • docker image builder that is not boot2docker or Kinematic
  • ability to spool up one or more VMs via REST
consider a workflow such as;
  1. build a Spring Boot app
  2. maven build calls appcatalyst-daemon and starts up your docker VM
  3. build a docker VM image and start it within the VM
  4. integration test
  5. shutdown
all based on docker containers, on a VM host that's REST managable

VMware Photon and Docker Remote Service

How to Enable Docker Remote Access on VMware Photon


  1. "sudo -s"
  2. "nano /etc/systemd/system/multi-user.target.wants/docker.service"
  3. change ExecStart to "ExecStart=/bin/docker -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -d -s overlay"
  4. save, exit, and restart the VM
  5. test with "curl localhost:2375/info" and the response should be a JSON document