Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to force tag in docker sbt native packager? #556

Closed
AshleyAitken opened this issue Apr 18, 2015 · 8 comments
Closed

How to force tag in docker sbt native packager? #556

AshleyAitken opened this issue Apr 18, 2015 · 8 comments
Labels

Comments

@AshleyAitken
Copy link

Hi,

When I use the update latest option for SBT docker native plugin I set like this:

dockerUpdateLatest in Docker := true

I get:

[info] Built image private.com/hedventures/a3-write-front:0.1-SNAPSHOT
time="2015-04-18T03:55:39+08:00" level="fatal" msg="Error response from daemon: Conflict: Tag latest is already set to image bdab0b723ec6e7378f6c0add1cbc54cb682d3e7a782d142d65482a829bb304d0, if you want to replace it, please use -f option"
[trace] Stack trace suppressed: run last a3-write-front/docker:publishLocal for the full output.
error Failed to run docker tag

I believe there already exists a private.com/hedventures/a3-write-front:0.1-SNAPSHOT with latest tag. This is a new build of that, i.e. the tagging as latest works the first time (if the images is not already tagged as latest) but fails the second (and subsequent times) publishLocal.

Is it possible to force (-f) the tagging somehow with SBT docker native plugin?

Thanks,
Ashley.

SBT 0.13
SBT Native Package 0.8.0-RC1

That is in response to a docker:publishLocal for a3-write-front.

Full error is:

[info] Built image tutum.co/hedventures/a3-write-front:0.1-SNAPSHOT
java.lang.RuntimeException: Failed to run docker tag
at scala.sys.package$.error(package.scala:27)
at com.typesafe.sbt.packager.docker.DockerPlugin$class.publishLocalDocker(DockerPlugin.scala:114)
at com.typesafe.sbt.SbtNativePackager$.publishLocalDocker(PackagerPlugin.scala:10)
at com.typesafe.sbt.packager.docker.DockerPlugin$$anonfun$dockerSettings$15.apply(DockerPlugin.scala:195)
at com.typesafe.sbt.packager.docker.DockerPlugin$$anonfun$dockerSettings$15.apply(DockerPlugin.scala:194)
at scala.Function5$$anonfun$tupled$1.apply(Function5.scala:35)
at scala.Function5$$anonfun$tupled$1.apply(Function5.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:235)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
error Failed to run docker tag

@AshleyAitken
Copy link
Author

Sorry, I believe SBT is 0.13.1 (well, that's what sbt --version says ;-)

@muuki88
Copy link
Contributor

muuki88 commented Apr 18, 2015

I think we only fixed this for the 1.0.0 branch. Why are you using 0.8.x?

@muuki88
Copy link
Contributor

muuki88 commented Apr 18, 2015

This issue is fixed in 0.8.0.

@muuki88 muuki88 closed this as completed Apr 18, 2015
@AshleyAitken
Copy link
Author

Thank you again @muuki88 I will upgrade. I looked at the docs and didn't see (or understand) how to force the latest option (or is that the default?). I will see, I guess.

@yanns
Copy link
Contributor

yanns commented Jul 17, 2017

I have this error when upgrading from 1.1.5 to 1.2.0.

I have this error on linux (Docker version 1.6.2, build 7c8fca2)
I don't have this error on mac (docker native - Docker version 17.06.0-ce, build 02c1d87)

Error on linux:

[09:17:25][Step 1/1] [info] Built image XXXX/YYYY:59320ca79fc0dd16e44e3fcf51a5eaba02d17def
[09:17:25][Step 1/1] [info] The push refers to a repository [docker.io/XXXX/YYYY]
[09:17:25][Step 1/1] time="2017-07-11T09:16:43Z" level=fatal msg="tag does not exist: XXXX/YYYY:59320ca79fc0dd16e44e3fcf51a5eaba02d17def" 
[09:17:26][Step 1/1] java.lang.RuntimeException: Nonzero exit value: 1
[09:17:26][Step 1/1] 	at scala.sys.package$.error(package.scala:27)
[09:17:26][Step 1/1] 	at com.typesafe.sbt.packager.docker.DockerPlugin$.publishDocker(DockerPlugin.scala:382)
[09:17:26][Step 1/1] 	at com.typesafe.sbt.packager.docker.DockerPlugin$$anonfun$projectSettings$23.apply(DockerPlugin.scala:131)
[09:17:26][Step 1/1] 	at com.typesafe.sbt.packager.docker.DockerPlugin$$anonfun$projectSettings$23.apply(DockerPlugin.scala:127)

@muuki88
Copy link
Contributor

muuki88 commented Jul 17, 2017

Thanks @yanns 😃😍

@yanns
Copy link
Contributor

yanns commented Jul 20, 2017

As documented in http://www.scala-sbt.org/sbt-native-packager/formats/docker.html#publishing-settings, the docker version should be >= 1.10

#871

@muuki88
Copy link
Contributor

muuki88 commented Jul 22, 2017

Thanks for clarifying 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants