YugabyteDB official Dockerfile

franckpachot

Franck Pachot

Posted on August 11, 2023

YugabyteDB official Dockerfile

You have seen me using the official YugabyteDB Docker image extensively. This image is suitable for various purposes, including labs, development, testing, and even production. In the past, we used to create it internally due to its seamless integration with our build process. However, some companies prefer to construct the image on their own, which is indeed a commendable practice. After all, it's not advisable to run random images with root privileges on your servers. As a result, we have made a significant alteration by introducing a refined Dockerfile to our Github repository.

Here's how I obtain the command to download the latest preview:

curl -Ls https://docs.yugabyte.com/preview/quick-start/linux/ |
 awk -F">" "/wget.*$(uname -m)/"'{sub(/wget/,"wget -c");print $NF}'

Enter fullscreen mode Exit fullscreen mode

You can also acquire the desired version from the download page

Subsequently, I retrieve the YugabyteDB source repository, download the release, and proceed to build the Docker image:


git clone https://github.com/yugabyte/yugabyte-db.git /var/tmp/yugabytedb
cd /var/tmp/yugabytedb/docker/images

# download the release from https://download.yugabyte.com/#linux
wget -c https://downloads.yugabyte.com/releases/2.19.0.0/yugabyte-2.19.0.0-b190-el8-aarch64.tar.gz
./build_docker.sh -f $(basename $_)

Enter fullscreen mode Exit fullscreen mode

If you utilize podman you can execute the same process by installing the podman-docker package (sudo dnf install -y podman-docker) to replace Docker commands with Podman equivalents. However, please note that the image requires certain root permissions, necessitating the command sudo ./build_docker.sh to be executed.

Image description

I haven't assigned a name to my image since this is merely a test. Nonetheless, I am able to run a container from it and perform YugabyteDB testing:
Image description

I can execute the identical steps using my repository name (-r pachot), incorporate the architecture into the version tag (-a) and apply the Docker option to consolidate all layers into a single layer (--squash-all):

sudo ./build_docker.sh -f yugabyte-2.19.0.0-b190-el8-aarch64.tar.gz -r pachot -a -l -- --squash-all

Enter fullscreen mode Exit fullscreen mode

The provided command initiates the following sequence: docker buildx build --build-arg VERSION=2.19.0.0-b190 --build-arg RELEASE=190-aarch64 --tag pachot/yugabyte:2.19.0.0-b190-aarch64 --output type=docker --squash-all .

Here is my image:

$ sudo docker images

Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
REPOSITORY                   TAG                    IMAGE ID      CREATED        SIZE
docker.io/pachot/yugabyte    2.19.0.0-b190-aarch64  18062b19e188  5 minutes ago  1.92 GB
docker.io/pachot/yugabyte    latest                 18062b19e188  5 minutes ago  1.92 GB
docker.io/library/almalinux  8                      554a0aef23e4  3 weeks ago    218 MB
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
franckpachot
Franck Pachot

Posted on August 11, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

YugabyteDB official Dockerfile
yugabytedb YugabyteDB official Dockerfile

August 11, 2023