Habitizing docker-compose

As docker-compose is “just a python program” I thought I’d try and get it habitized

Background

The final composite plan is going looking like
docker, docker-compose, chefdk. So we can run ChefDK reliably in a CI environment.

The Plan

Problem

Running docker-compose returns no such file.
Permissions are 755

LD returns what it looks like missing libraries.
ld /hab/pkgs/damacus/docker-compose/1.19.0/20180305154940/bin/docker-compose
/hab/pkgs/core/binutils/2.25.1/20170513201927/bin/ld.bfd.real: error in /hab/pkgs/damacus/docker-compose/1.19.0/20180305154940/bin/docker-compose(.eh_frame); no .eh_frame_hdr table will be created.
/hab/pkgs/core/binutils/2.25.1/20170513201927/bin/ld.bfd.real: warning: cannot find entry symbol _start; defaulting to 0000000000401880

docker-compose requires the python-dev headers which are already included in the python package.

Couple of questions:

  • Why the dep on hab-pkg-export-docker?
  • Docker-compose is a python script? Is it possible it has the wrong interpreter set?

hab-pkg-export-docker so I can quickly export it at the end of the build. I’m being lazy (this isn’t the final form)

This “looks” correct

I’m downloading the linux version of the binary. Best way of sanity checking that assumption?

Ah actually that’s incorrect. You want to replace /usr/bin/env python with <path to hab python>. There are a couple ways to go about this. You can use sed directly to replace the shebang line or you can take a dep on coreutils and use fix_interpreter

oh beautiful, that would have stumped me for ages!

This is also probably what’s wrong with the rpm2cpio package I was just playing with too :wink:

Let us know if this gets you unblocked. I have done a handful of python apps and there are definitely sometimes where I prefer to use pip and virtualenv to make a binary available over trying to “compile from source” or whatever. Anything we can get documented on this is probably useful to others!

Will do!

I’m doing something wrong with fix_interpreter. So I’m going to give it a go with a fresh pair of eyes.