(Alpine + JFrog CLI) @ Docker

One more article about my Docker images.

JFrog runs an awesome Bintray — universal distribution platform — as they say on their site. You can host literally any of your open-source artifacts there for free: Docker images, NPM libraries, DEB and RPM packages, Maven JARs, Conan and NuGet package, Vagrant boxes. Or just go with “Generic” and store other formats. JFrog also stands behind Artifactory and some other tools.

It’s really cool and you should give it a try as an alternative to GitHub’s releases.

Note for Gradle users: Bintray hosts JCenter — the largest Maven repo on the Earth. JCenter “proxies” Maven Central and can be used as a drop-in replacement for it. Plus, it has other artifacts not found in Maven Central. Using JCenter in Gradle is super-easy: just add jcenter() to the repositories section.

Though, Bintray’s search (and JCenter’s as a result) sucks.

You can upload / publish your artifacts to Bintray using a plugin for your build tool (I know there is one for Gradle) or you can use their REST API. It’s as easy as HTTP POST.

However, there is better approach: using JFrog CLI. It’s a “one tool to rule them all” for all JFrog’s products. Using the CLI is even simpler then curl and hides any protocol hustle and implementation details which is good.

I want to use JFrog CLI in my GitLab / Bitbucket pipelines, so I need a Docker image with it. Let’s see what Docker Hub has? It has several automated builds with JFrog CLI @ Ubuntu / Debian and a dozen of non-automated builds which I didn’t even bother to check: non-automated builds are crap and should be banned.

I believe we can cut image size up to five times (actually, ~7 times) if we choose Alpine as a base.

I was surprised to find this issue and no image in Hub, so untill JFrog publish their image I made my own.

The usage is pretty simple:

  stage: publish
    name: madhead/lv-alpina:latest
    - JFROG_CLI_OFFER_CONFIG=false jfrog bt upload --user user --key key path/to/binary/for.upload bintray-user/bintray-repo/bintray-package/version path/in/bintray-repo/
comments powered by Disqus