portainer / compose-unpacker

A tool used to deploy Compose stacks from Git on remote environments
8 stars 7 forks source link

Unable to deploy a stack when using the relative path option - Error 255 #23

Open ThaDaVos opened 1 year ago

ThaDaVos commented 1 year ago

Linking from: https://github.com/orgs/portainer/discussions/9300

The compose-unpacker, at least in my case, seems to fail when a private registry is used - even when credentials etc are all correct:

{"level":"info","time":1692996405,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:297","message":"Docker login docker.io successed"}
{"level":"info","time":1692996405,"caller":"/home/runner/work/compose-unpacker/compose-unpacker/deploy.go:323","message":"Docker logout docker.io successed"}
docker login failure

I am creating this issue to check on the code and maybe create a PR eventually - unless this is an already known problem, then hopefully there's a fix in the works already

ThaDaVos commented 1 year ago

A few things I already see being wrong in the code:

  1. Password is passed plain - so if your password contains a : - it breaks
  2. No support for custom registries which use a port in their definition - breaks as the login is split and checked to be equal to 3

To fix 1: The password should be passed encoded - so it doesn't contain forbidden characters To fix 2: Different way of parsing of the registry strings which is less faulty