The Artima Developer Community
Sponsored Link

Java Buzz Forum
Deploy Java Apps With Docker = Awesome

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Mathias Bogaert

Posts: 618
Nickname: pathos
Registered: Aug, 2003

Mathias Bogaert is a senior software architect at Intrasoft mainly doing projects for the EC.
Deploy Java Apps With Docker = Awesome Posted: Jun 24, 2013 6:02 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Mathias Bogaert.
Original Post: Deploy Java Apps With Docker = Awesome
Feed Title: Scuttlebutt
Feed URL:
Feed Description: tech gossip by mathias
Latest Java Buzz Posts
Latest Java Buzz Posts by Mathias Bogaert
Latest Posts From Scuttlebutt

You may remember a blog post I wrote some time ago about Java provisioning with Vagrant. Today I’ll be exploring something that rivals and complements that in coolness. Today I would like to tell you about Docker and show you how awesome it is. New to Docker? Here is an intro in their own word: “Docker is an open-source engine which automates the deployment of applications as highly portable, self-sufficient containers which are independent of hardware, language, framework, packaging system and hosting provider.” When I first heard about Docker I reviewed the demo and examples on their site – let’s say it peaked my curiosity. Cheap, zero-penalty containers to deploy services? A VM without the overhead of a VM? Instant replay and reset of image snapshots? I have to try this… Docker provides a streamlined user interface and API over the very cool lxc (Linux Containers) and aufs (advanced multi layered unification filesystem) to configure, spin up, down, set and replay light weight vm-like containers. Below I will provide an example of how to use Docker to deploy a Java application inside a container. I’ll use Stash – the coolsome git repository management tool I work on everyday – as a sample application (but you can replace it with any other Atlassian product or Java application of your choosing). Preparation for Mac users You can skip this section if you are already on Linux. If you’re working on a Mac you have to go through a VM or Vagrant to use Docker: it is only available on Linux (support for the other platforms is in development and planned). Using Vagrant, spin up a recent Ubuntu box by creating the following Vagrantfile and typing vagrant up at a terminal: do |config| = "raring"   config.vm.box_url = ""   config.vm.forward_port 7990, 7991   config.vm.share_folder("vagrant-root", "/vagrant", ".")   config.vm.customize ["modifyvm", :id, "--memory", 2048] end In the file we map port 7990 (Stash’s default port) to 7991 on the host so that later we can test the installation from the Mac. After that is complete you can ssh into your box with vagrant ssh and you’re ready to install Docker. (Thanks to robknight for the simple Vagrant setup I am re-using.) Now that you are inside the vagrant VM we can install Docker. Administrative Stuff (Skip freely) On any new box I need vim, curl and git to deploy my .dotfiles otherwise I can’t function properly: 123sudo apt-get install vim curl git curl -Lks | bash Install Docker Installing Docker is easy. First we install some kernel extensions needed for it to run: 1sudo apt-get install linux-image-extra-$(uname -r) Then we install software-properties-common which provides us with add-apt-repository: 1sudo apt-get install software-properties-common Add the dotcloud ppa: 12sudo add-apt-repository ppa:dotcloud/lxc-docker sudo apt-get update And finally install Docker with: 1sudo apt-get install lxc-docker Now we are ready to pull a base image which will be the base of all our work: 1docker pull base This will output: 123456789Pulling repository base from Pulling [...]

Read: Deploy Java Apps With Docker = Awesome

Topic: Animation Resources and AnimationListener Previous Topic   Next Topic Topic: Transactional Lucene

Sponsored Links


Copyright © 1996-2017 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us