Docker typical workflow (rough notes)

I’m still scratching the surface getting up to speed with Docker, but here’s some rough notes for what seems to be a typical development workflow.

Build an image (from Dockerfile):

docker build -t imagename .

Run an image (create a container):

docker run -d -p port:port imagename

 

If pushing an image to a local Registry to share to other machines:

Tag an image:

docker tag imagename ip-of-registry:port/imagename

Push image to registry:

docker push ip-of-registry:port/imagename

For my other notes and experiences in Dockerland so far, see here.

Managing Docker containers with Shipyard

There’s plenty of things that amaze me about Docker, but one of the things I find interesting is the number of available images with all sorts of stuff preconfigured and ready to spin up, including Docker management related tools like Shipyard that also run within Docker containers themselves.

Installing couldn’t be simpler, just pull down a script and run it, and it pulls down a number of images and spins them up:

curl -sSL https://shipyard-project.com/deploy | bash -s

Within a few seconds Shipyard is up and running, and after logging on, you get the snappy looking dashboard:

Now, off to do a bit more studying to configure a spin up a Swarm cluster 🙂

Lightweight docker images for Java apps

There’s a number of posts (e.g. here) talking about the official Java docker images being on the large side – in Docker terms, the standard images at > 600MB before you even build your image containing you app are … pretty big.

Suggestions are to use a smaller image as a starting point, like Alpine Linux. It looks like at some point the official Java images have been updates to include a number of Alpine based images too.

Pulling down an OpenJDK 8 image, java:openjdk-8-jdk and then java:openjdk-8-alpine, there’s a massive size difference between the size of the two:

If you’re planning on running something lightweight like a Spring Boot app, looks like the provided Alpine images are a good starting point.

Node.js online courses and self-paced tutorials

I’m always looking for resources for learning something new. I’m currently digging into some Node.js. I’ve been working through a Udemy course, ‘The Complete Node.js Developer Course’, and while the quality of the materials and videos is very good, I’m finding the initial pace of the videos a bit slow for my liking (you can run them at 1.5x and 2x which helps to get through them quicker). If you were starting from zero background in JavaScript then the initial pace is probably spot on, but if you have some background already, then you might want to skip ahead.

Looking for other sources, I came across http://nodeschool.io/ . The interesting thing with their approach is they have Node.js apps that drive your tutorials and assess your solutions to the puzzles. I’ve been working though learnyounode and so far it’s going pretty well. Install with:

npm install -g learnyounode