Bicep Container Image

While using the Azure CLI container image for one of my side projects, I started looking for an image that contains Bicep CLI as well. I found Mikolaj Mackowiak’s Bicep-cli image. This was what I really needed and it includes both Azure CLI and Bicep CLI. However, just as a fun side project, I wanted to publish my own image as well.

I started with Alpine base image and started building everything needed for Azure CLI and Bicep CLI. However, as I started building all dependencies, the size of this image grew from 5MB to ~1GB. This is when I switched the base layer to Microsoft’s Azure CLI image and just added Bicep as a layer.

Here is how my Dockerfile looks now.

LABEL maintainer=""

RUN curl -Lo bicep.bin \
 && chmod +x ./bicep.bin \
 && mv ./bicep.bin /usr/local/bin/bicep

Update (05/21) - Optimized the Dockerfile to reduce number of image layers.

This is available in my Bicephelpers GitHub repository and I have a GitHub action that builds this image and pushes to Docker Hub.

You can pull this image using the following command line.

docker image pull ravikanth/bicep:latest

I will continue to update this whenever Azure CLI or Bicep CLI get updated.

Share on: