Closed dmytro closed 7 years ago
Are you sure that the docker:publishLocal
command succeed? Could you post sbt output and/or try running the printed Docker command manually?
Since the image depends on another image from Amazon ECR, you'll need to ecr:login
before the image is built - try executing ecr:login
before docker:publishLocal
.
Hi,
To answer your questions:
docker images
before and after sbt
). I'm calling docker:localPublish
explicitly in my alias publish
:
addCommandAlias("publish", ";clean;compile;docker:publishLocal;ecr:createRepository;ecr:login;ecr:push")
Here's full sbt output:
[dmytro@Svaroh-2 my-project]$ docker images | grep myproject
[dmytro@Svaroh-2 my-project]$ sbt publish
[info] Loading project definition from /Users/dmytro/my-project/project
[info] Set current project to myproject (in build file:/Users/dmytro/my-project/)
[success] Total time: 0 s, completed Jan 31, 2017 5:41:29 PM
[info] Updating {file:/Users/dmytro/my-project/}my-project...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Compiling 5 Scala sources and 1 Java source to /Users/dmytro/my-project/target/scala-2.10/classes...
[success] Total time: 8 s, completed Jan 31, 2017 5:41:37 PM
[info] Packaging /Users/dmytro/my-project/target/scala-2.10/myproject_2.10-latest-sources.jar ...
[info] Done packaging.
[info] Wrote /Users/dmytro/my-project/target/scala-2.10/myproject_2.10-latest.pom
[info] Main Scala API documentation to /Users/dmytro/my-project/target/scala-2.10/api...
[info] Packaging /Users/dmytro/my-project/target/scala-2.10/myproject_2.10-latest.jar ...
[info] Done packaging.
model contains 19 documentable templates
[info] Main Scala API documentation successful.
[info] Packaging /Users/dmytro/my-project/target/scala-2.10/myproject_2.10-latest-javadoc.jar ...
[info] Done packaging.
[info] Sending build context to Docker daemon 41.85 MB
[info] Step 1/8 : FROM <AWS_ACCOUNT>.dkr.ecr.us-east-1.amazonaws.com/java:latest
[info] ---> d5c4c8395ef9
[info] Step 2/8 : WORKDIR /opt/docker
[info] ---> 2d3ebf835c83
[info] Removing intermediate container 1ebe8d921b0d
[info] Step 3/8 : ADD opt /opt
[info] ---> 646798f0a0d2
[info] Removing intermediate container 6e1d6291cb18
[info] Step 4/8 : RUN chown -R daemon:daemon .
[info] ---> Running in a7885de1e640
[info] ---> 590bfa522f25
[info] Removing intermediate container a7885de1e640
[info] Step 5/8 : EXPOSE 9000
[info] ---> Running in ce2ad46ec38c
[info] ---> 92a183055821
[info] Removing intermediate container ce2ad46ec38c
[info] Step 6/8 : USER daemon
[info] ---> Running in 48df9e265abc
[info] ---> 9919ad6fa6cf
[info] Removing intermediate container 48df9e265abc
[info] Step 7/8 : ENTRYPOINT bin/myproject
[info] ---> Running in 492053822e07
[info] ---> 7cd410276395
[info] Removing intermediate container 492053822e07
[info] Step 8/8 : CMD
[info] ---> Running in 521ec42136eb
[info] ---> 9da9cf4d5a9f
[info] Removing intermediate container 521ec42136eb
[info] Successfully built 9da9cf4d5a9f
[info] Built image myproject:latest
[success] Total time: 12 s, completed Jan 31, 2017 5:41:49 PM
[info] Repository exists: us-east-1/myproject
[success] Total time: 2 s, completed Jan 31, 2017 5:41:50 PM
[info] AWS account id: <AWS_ACCOUNT>
Flag --email has been deprecated, will be removed in 1.14.
Login Succeeded
[success] Total time: 4 s, completed Jan 31, 2017 5:41:54 PM
[success] Total time: 0 s, completed Jan 31, 2017 5:41:54 PM
[dmytro@Svaroh-2 my-project]$ docker images | grep myproject
myproject latest 9da9cf4d5a9f 12 seconds ago 257 MB
[dmytro@Svaroh-2 my-project]$
Thanks for the detailed description. Unfortunately, I'm unable to reproduce this issue in my local environment.
Few things that come to mind:
0.13.12
and it works as expected. ecr:push
points to the right place (i.e. inspect ecr:push
). docker tag myimage <aws_account>.dkr.ecr.us-east-1.amazonaws.com/myimage
work as expected? Sorry for the confusion. It was my problem, I was using sbt 0.13.13
, operator <<=
is deprecated and there was a syntax error in push in ecr <<= (push in ecr) dependsOn (publishLocal in Docker)
line.
I'm using version
0.3.0
of thesbt-ecr
plugin, but I'm not able to push the image. Two other commandsecr:login
andecr:createRepository
work OK, but push apparently does nothing.I am using Docker 1.13 on a Mac, and my suspicion that tagging https://github.com/sbilinski/sbt-ecr/blob/master/src/main/scala/sbtecr/EcrPlugin.scala#L57) step does not work. I am not a Scala person, but if I understand this code correctly, it should add tag to the the image with the registry name prepended.
When I run
docker images
afterecr:push
image is not tagged:This is my configuration:
And docker version: