sparse-intern-71089
08/03/2020, 11:04 AMlimited-rainbow-51650
08/03/2020, 11:34 AMlimited-rainbow-51650
08/03/2020, 11:41 AMdazzling-sundown-39670
08/03/2020, 11:44 AMconst registry = new digitalocean.ContainerRegistry('microservices')
dazzling-sundown-39670
08/03/2020, 11:45 AMconst testImage = new docker.Image('microservices', {
build: '../microservices',
imageName: 'microservices',
registry: ???
})
limited-rainbow-51650
08/03/2020, 11:47 AMdazzling-sundown-39670
08/03/2020, 11:47 AMnew digitalocean.ContainerRegistry
dazzling-sundown-39670
08/03/2020, 11:48 AMlimited-rainbow-51650
08/03/2020, 11:50 AMregistry
resource, you have the endpoint
as well as serverUrl
outputs. I guess you have to use one of these as the registry
for the testImage
resource.dazzling-sundown-39670
08/03/2020, 11:51 AMcredentials
doesn't contain the key dockerCredentials
limited-rainbow-51650
08/03/2020, 12:00 PMdazzling-sundown-39670
08/03/2020, 12:18 PMdazzling-sundown-39670
08/03/2020, 12:18 PMconst registry = new digitalocean.ContainerRegistry('microservices-test');
export const credentials = new digitalocean.ContainerRegistryDockerCredentials(
'microservices',
{
registryName: registry.name,
write: true,
expirySeconds: 60 * 60 * 365 * 49, // 49 years
},
);
export const dockerRegistryCredentials = credentials.dockerCredentials.apply(
(credentials) => {
const json = JSON.parse(credentials);
const base64 = json.auths['<http://registry.digitalocean.com|registry.digitalocean.com>'].auth;
const [username, password] = atob(base64).split(':');
return {
username,
password,
server: '<http://registry.digitalocean.com|registry.digitalocean.com>',
};
},
);
export const testImage = new docker.Image('microservices', {
build: '../microservices',
imageName: 'microservices',
registry: dockerRegistryCredentials,
});
dazzling-sundown-39670
08/03/2020, 12:18 PMerror: denied: requested access to the resource is denied
dazzling-sundown-39670
08/03/2020, 12:19 PMThe push refers to repository [<http://docker.io/library/microservices|docker.io/library/microservices>]
limited-rainbow-51650
08/03/2020, 12:22 PMimageName
to the format
<http://registry.digitalocean.com/<my-registry>/<my-image|registry.digitalocean.com/<my-registry>/<my-image>>
like you would if you used plain docker push
limited-rainbow-51650
08/03/2020, 12:23 PMdocker push
under the hooddazzling-sundown-39670
08/03/2020, 12:29 PMdazzling-sundown-39670
08/03/2020, 12:31 PM