Live data from Hacker News

A Go, Docker workflow

blog.crowdpatent.com

1–10 of 16 posts

Re: A Go, Docker workflow

#2
Worth checking out docker-compose for more complex setups (if you need a Redis and PostgreSQL database running for example). I have been using it for Node.js development for the past few months and it is really a life changer especially if you are working on multiple projects concurrently. Pro-tip: `echo "alias dc=docker-compose" >> ~/.zshrc`

Re: A Go, Docker workflow

#3
post #2

Worth checking out docker-compose for more complex setups (if you need a Redis and PostgreSQL database running for example). I have been using it for Node.js development for the past few months and it is really a life changer especially if you are working on multiple projects concurrently. Pro-tip: `echo "alias dc=docker-compose" >> ~/.zshrc`

Yes, docker-compose (https://docs.docker.com/compose/) is just great. Another sweet tool, but I haven't used it in production yet, is empire (https://github.com/remind101/empire) for deployment (AWS centric).

Re: A Go, Docker workflow

#4
That Makefile is... weird. Why issue a "make sub-target" command? Makefiles are all about understanding dependencies, so you should actually be doing

    target: dependency
        
...instead of

    target:
        make dependency
        
Doing it this way actually breaks dependency checks. It's just plain wrong.

Here's a "proper" Makefile, complete with conditionals, expansion, etc.:

https://github.com/rcarmo/sushy/blob/master/Makefile

...and here's one of my Go Makefiles (no sub-targets here, but does vendoring in a way that's quite similar to what Go 1.5 turned out to adopt)

https://github.com/rcarmo/go-rss2imap/blob/master/Makefile

(edit: whitespace)

Re: A Go, Docker workflow

#5
post #2

Worth checking out docker-compose for more complex setups (if you need a Redis and PostgreSQL database running for example). I have been using it for Node.js development for the past few months and it is really a life changer especially if you are working on multiple projects concurrently. Pro-tip: `echo "alias dc=docker-compose" >> ~/.zshrc`

Yeah. I've been using fig for a while now (and will eventually replace everything with compose), and it's simpler than Vagrant for reproducible environments.

There is one little caveat when using boot2docker, in that when you're running tests on a separate terminal you need to be careful to remember to do $(boot2docker shellinit) _and_ expose container ports so that they're visible outside the boot2docker VM - so check your IPs and make sure your containers log the environment variables they're using for links, so that you can check where to connect your tests :)

Re: A Go, Docker workflow

#6
post #4

That Makefile is... weird. Why issue a "make sub-target" command? Makefiles are all about understanding dependencies, so you should actually be doing target: dependency ...instead of target: make dependency Doing it this way actually breaks dependency checks. It's just plain wrong. Here's a "proper" Makefile, complete with conditionals, expansion, etc.: https://github.com/rcarmo/sushy/blob/master/Makefile ...and here…

Thanks rcarmo for bringing this up. You're right, it is a better, and the only right, approach to declare the dependencies like you proposed. I've updated the code!

Re: A Go, Docker workflow

#7
post #2

Worth checking out docker-compose for more complex setups (if you need a Redis and PostgreSQL database running for example). I have been using it for Node.js development for the past few months and it is really a life changer especially if you are working on multiple projects concurrently. Pro-tip: `echo "alias dc=docker-compose" >> ~/.zshrc`

Has one of you tried xhyve? https://coreos.com/blog/coreos-and-xhyve-tech-preview/

Re: A Go, Docker workflow

#8
post #2

Worth checking out docker-compose for more complex setups (if you need a Redis and PostgreSQL database running for example). I have been using it for Node.js development for the past few months and it is really a life changer especially if you are working on multiple projects concurrently. Pro-tip: `echo "alias dc=docker-compose" >> ~/.zshrc`

Has one of you tried xhyve? https://coreos.com/blog/coreos-and-xhyve-tech-preview/

[deleted]

Re: A Go, Docker workflow

#9
post #2

Worth checking out docker-compose for more complex setups (if you need a Redis and PostgreSQL database running for example). I have been using it for Node.js development for the past few months and it is really a life changer especially if you are working on multiple projects concurrently. Pro-tip: `echo "alias dc=docker-compose" >> ~/.zshrc`

Has one of you tried xhyve? https://coreos.com/blog/coreos-and-xhyve-tech-preview/

https://github.com/ailispaw/boot2docker-xhyve

Re: A Go, Docker workflow

#10
post #2

Worth checking out docker-compose for more complex setups (if you need a Redis and PostgreSQL database running for example). I have been using it for Node.js development for the past few months and it is really a life changer especially if you are working on multiple projects concurrently. Pro-tip: `echo "alias dc=docker-compose" >> ~/.zshrc`

Has one of you tried xhyve? https://coreos.com/blog/coreos-and-xhyve-tech-preview/

Haven't heard but thanks for pointing out. It might be pretty useful actually as I develop on OS X and use CoreOS in production.
Post reply on HN