You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a requirement to build two dockerfiles from one module. These will have different base images and various configurations.
The plugin seems to assume a singular docker artifact per module. I can do some messy stuff in sbt... that gets more and more messy by making my own set of configuration keys that mirror everything the plugin does, clones of 'docker' 'dockerBuildAndPush' etc.
That is a horrible way to go about it. Is there a better way?
The text was updated successfully, but these errors were encountered:
I've came up with following approach. Not ideal, but gets the job done:
dockerfile in docker := {
if (sys.env.get("SOME_VALUE").isDefined) {
newDockerfile {
… // some docker file
}
} else {
newDockerfile {
… // alternative docker file
}
}
}
Basically, in sbt you can have arbitrary code inside the task definition body. You can access environment, read settings, etc. Hope this helps.
P.S. A better way would be not to scope sbt-docker's settings and values under docker task key, but rather let them be scoped in natural sbt way. Then one could've defined e.g. custom sbt configurations to scope dockerfile, imageNames, etc.
I have a requirement to build two dockerfiles from one module. These will have different base images and various configurations.
The plugin seems to assume a singular docker artifact per module. I can do some messy stuff in sbt... that gets more and more messy by making my own set of configuration keys that mirror everything the plugin does, clones of 'docker' 'dockerBuildAndPush' etc.
That is a horrible way to go about it. Is there a better way?
The text was updated successfully, but these errors were encountered: