Skip to content
forked from sjednac/sbt-ecr

An SBT plugin for managing Docker images within Amazon ECR.

License

Notifications You must be signed in to change notification settings

markusjura/sbt-ecr

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sbt-ecr

An SBT plugin for managing Docker images within Amazon ECR.

Download

Features

  • Create ECR repositories using ecr:createRepository
  • Login to the remote registry using ecr:login
  • Push local images using ecr:push

Installation

Add the following to your project/plugins.sbt file:

addSbtPlugin("com.mintbeans" % "sbt-ecr" % "0.7.0")

Add ECR settings to your build.sbt. The following snippet assumes a Docker image build using sbt-native-packager:

import com.amazonaws.regions.{Region, Regions}

enablePlugins(EcrPlugin)

region           in ecr := Region.getRegion(Regions.US_EAST_1)
repositoryName   in ecr := (packageName in Docker).value
localDockerImage in ecr := (packageName in Docker).value + ":" + (version in Docker).value

// Create the repository before authentication takes place (optional)
login in ecr <<= (login in ecr) dependsOn (createRepository in ecr)

// Authenticate and publish a local Docker image before pushing to ECR
push in ecr <<= (push in ecr) dependsOn (publishLocal in Docker, login in ecr)

Tagging

By default, the produced image will be tagged as "latest". It is possible to provide arbitrary additional tags, for example to add the version tag to the image:

repositoryTags in ecr ++= Seq(version.value)

If you don't want latest tag on your image you could override the repositoryTags value completely:

repositoryTags in ecr := Seq(version.value)

About

An SBT plugin for managing Docker images within Amazon ECR.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 100.0%