question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fabric8:push fails going to AWS ECS

See original GitHub issue

I am doing local development using Docker for Windows (18.03.1-ce-win65 (17513)) in Linux mode (although I do switch to Windows mode periodically), and fabric8-maven-plugin to build and push images. I’ve run a local registry inside Docker, and am able to push to that using f-m-p.

However, when I use a repository on AWS ECS, I get: Failed to execute goal io.fabric8:fabric8-maven-plugin:3.5.40:push (default-cli) on project jenkins-master: Unable to push 'dbg/jenkins-master' from registry 'xxxx.dkr.ecr.us-west-2.amazonaws.com' : no basic auth credentials -> [Help 1]

I’ve successfully tagged, and pushed to this repo using the docker commandline. So I conclude the issue is with f-m-p. E.g.:

$ docker tag dbg/jenkins-master xxxx.dkr.ecr.us-west-2.amazonaws.com/dbg/jenkins-master
$ docker push xxxx.dkr.ecr.us-west-2.amazonaws.com/dbg/jenkins-master

The config files here are a little ugly, as I’ve bee trying different workarounds. I would prefer if the system worked with wincred, for safety, since it is integrated with the daily aws get-login system, to avoid cutting and pasting things into config files each day.

For testing, it is easy to create a free aws ecs account, which comes with a registry.

For reference, I suspect it is related to something like the docker-maven-plugin folks faced: https://github.com/spotify/docker-maven-plugin/issues/181

For login: aws ecr get-login --no-include-email which spits out a docker login command that you paste into the cli again: docker login -u AWS -p ppp https://xxx.dkr.ecr.us-west-2.amazonaws.com Maven: 3.3.9 f-m-p: 3.5.40

.docker/config.json:

{
	"auths": {
		"xxx.dkr.ecr.us-west-2.amazonaws.com": {},
		"https://xxx.dkr.ecr.us-west-2.amazonaws.com": {}
	},
	"HttpHeaders": {
		"User-Agent": "Docker-Client/18.03.1-ce (windows)"
	},
	"credsStore": "wincred"
}

Pom:

  <properties>
       <fabric8-version>3.5.40</fabric8-version>
       <fabric8.mode>auto</fabric8.mode>
       <fabric8.debug.enabled>true</fabric8.debug.enabled>
       <docker.verbose>true</docker.verbose>
       <docker.registry>xxx.dkr.ecr.us-west-2.amazonaws.com</docker.registry>
       <docker.apiVersion>1.37</docker.apiVersion>
   </properties>

   <build>
       <resources>
           <resource>
               <directory>src/main/fabric8</directory>
               <filtering>true</filtering>
           </resource>
           <resource>
               <directory>src/main/docker</directory>
               <filtering>true</filtering>
           </resource>
           <resource>
               <directory>src/main/resources</directory>
           </resource>
       </resources>
       <plugins>
           <plugin>
               <groupId>io.fabric8</groupId>
               <artifactId>fabric8-maven-plugin</artifactId>
               <version>${fabric8-version}</version>
               <configuration>
                   <verbose>true</verbose>
                   <images>
                       <image>
                           <name>dbg/jenkins-master</name>
                           <alias>dbg/jenkins-master</alias>
                           <build>
                               <dockerFile>JenkinsMaster.Dockerfile</dockerFile>
                               <filter>@</filter>
                           </build>
                       </image>
                        </images>
               </configuration>
           </plugin>
       </plugins>
   </build>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Beennnncommented, Dec 29, 2018

@rohanKanojia I just migrated on the new tag yesterday. I hope I can give you a feedback soon

0reactions
rohanKanojiacommented, Feb 8, 2019

@Beennnn : Hm, okay. I’m closing this for now.Feel free to re-open anyone faces this again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to push docker image to Amazon ECR using io.fabric8 ...
Use correct environment variables in the shell where the fabric8 maven-docker-plugin is executed: AWS_SDK_LOAD_CONFIG=true AWS_PROFILE= ...
Read more >
fabric8io/docker-maven-plugin
fabric8 :helloworld' [ERROR] DOCKER> Failed to create assembly for docker image (with mode 'dir'): Error creating assembly archive docker: You ...
Read more >
Troubleshoot ECS tasks stopping or failing to start
My Amazon Elastic Container Service (Amazon ECS) container exits unexpectedly, and tasks stop or fail to start. How can resolve the issue?
Read more >
CannotPullContainer task errors - Amazon Elastic Container ...
The common cause for this error is because the VPC your task is using doesn't have a route to pull the container image...
Read more >
How to use Fabric8 maven docker plugin (Introduction)
The aim is to ship the application to a docker image and utilize dockers build, start, push commands in a configured manner.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found