Pilothouse-App / Pilothouse

A command line app for managing a LEMP local development environment based on Docker.
http://pilothouse-app.org
GNU General Public License v2.0
98 stars 17 forks source link

Compatibility with Docker Compose 1.23.0+ #115

Closed spitlo closed 5 years ago

spitlo commented 5 years ago

Since 1.23.0 (release notes), Docker Compose adds a hash at the end of container names, breaking Pilothouse functionality (more specifically getContainerInternalIp).

I was able to fix this locally by getting container name from docker ps, but I'm not sure that is the best way to go about it.

Anyhow, my local, working version of getContainerInternalIp looks like this:

function getContainerInternalIp(container) {
    const containerPrefix = `pilothouse_${container}_`
    const containerName = commands.shellCommand(environment.runDirectory, 'docker', [
        'ps',
        '-a',
        '--format', '{{.Names}}',
        '--filter', `name=${containerPrefix}`,
    ], true);
    return commands.shellCommand(environment.runDirectory, 'docker', [
        'inspect',
        '--format', '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}',
        containerName,
    ], true);
}
philipnewcomer commented 5 years ago

Thanks for the heads up @spitlo. I've released 0.14.4 which should resolve this issue.

spitlo commented 5 years ago

Works perfectly, thanks!