richfitz / stevedore

:cloud::rowboat::whale::cloud: Docker client for R
https://richfitz.github.io/stevedore
Other
134 stars 10 forks source link

Problem with the construction of the tag image string in `mcr_prepare_push` #61

Open teofiln opened 1 year ago

teofiln commented 1 year ago

Hi @richfitz!

Trying to push an image to AWS ECR using stevedore. Below is the error I get:

> d <- stevedore::docker_client()
Detected API version '1.41' is above max version '1.39'; downgrading
> d$image$push(name = "xxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/testfromr")
The push refers to repository [xxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/449283523352.dkr.ecr.us-east-1.amazonaws.com/testfromr]
An image does not exist locally with the tag: xxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/449283523352.dkr.ecr.us-east-1.amazonaws.com/testfromr
Error: An image does not exist locally with the tag: xxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/449283523352.dkr.ecr.us-east-1.amazonaws.com/testfromr

I traced it to here: https://github.com/richfitz/stevedore/blob/5c281a89f464b4034868cd9f3ac075edb51f5252/R/docker_client_support.R#L836

Line 836 should read:

name <- sprintf("%s/%s", name$registry, name$name)

After which, it works:

> d <- stevedore::docker_client()
Detected API version '1.41' is above max version '1.39'; downgrading
> d$image$push(name = "xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/testfromr")
The push refers to repository [xxxxxxxxx.dkr.ecr.us-east-1.amazonaws.com/testfromr]
Preparing 6ec33114c675
Preparing fce85200c8f4
...

@richfitz What would be a good way to handle this? Should I make a PR? Against the develop branch?

Thanks for the great package!

richfitz commented 1 year ago

Thanks for the report - a PR would be great if you could. Just make it into master please