Skip to content

Commit

Permalink
Add branch suffix.
Browse files Browse the repository at this point in the history
  • Loading branch information
ober committed Oct 18, 2023
1 parent 74ec9ba commit 3e0b206
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ jobs:
- name: Push to Docker Hub on Pushes to master
run: |
docker login -u gerbil -p ${{ secrets.DOCKER_TOKEN }}
docker push gerbil/${{ matrix.docker-image }}:$(uname -m)
docker push gerbil/${{ matrix.docker-image }}:$(uname -m)-master
docker manifest create gerbil/${{ matrix.docker-image }}:master --amend gerbil/gerbil:aarch64-master --amend gerbil/gerbil:x86_64-master
docker manifest push gerbil/${{ matrix.docker-image }}:master
if: github.event_name == 'push'
3 changes: 3 additions & 0 deletions doc/guide/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ We offer two official docker images based on Alpine Linux:
- `gerbilxx` is the full image, configured without shared libraries and with C++ enabled.
It also includes all the foreign dependencies required by the officially supported
external packages.
- Supported architectures are `aarch64` and `x86_64`.
- `:latest` always points at the last release, e.g. `v0.18`
- `:master` points to the latest merge into the `master` branch.

Alpine was chosen due to the static compilation environment and capabilities it provides.

Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN case ${distro} in \
yum update -y && yum groupinstall -y 'Development Tools' && \
eval yum install -y ${packages} \
;; \
ubuntu) \
debian|ubuntu) \
apt update -y && \
eval apt install -y ${packages} \
;; \
Expand All @@ -51,7 +51,8 @@ ARG shared
RUN cd /opt && eval git clone -b "${branch}" "https://github.com/${repo}" gerbil-src \
&& cd /opt/gerbil-src && eval ./configure --prefix=/opt/gerbil --enable-shared=${shared} ${configure_args}

RUN cd /opt/gerbil-src && make && make install
RUN cd /opt/gerbil-src && make
RUN cd /opt/gerbil-src && make install

FROM gerbil as final
RUN rm -rf /opt/gerbil-src /src/leveldb /src/lmdb
Expand Down
53 changes: 45 additions & 8 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: alpine amazonlinux ubuntu fedora ubuntu-current-jedi final
.PHONY: alpine amazonlinux debian ubuntu fedora ubuntu-current-jedi final

ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
cores := $(shell nproc)
Expand Down Expand Up @@ -96,6 +96,28 @@ ubuntu_packages := autoconf \
texinfo \
zlib1g-dev

debian_packages := autoconf \
bison \
build-essential \
curl \
gawk \
git \
libleveldb-dev \
libleveldb1d \
liblmdb-dev \
libnss3-dev \
libsnappy1v5 \
libsqlite3-dev \
libssl-dev \
libxml2-dev \
libyaml-dev \
pkg-config \
python3 \
rsync \
rubygems \
texinfo \
zlib1g-dev

gerbilxx:
docker build --target final \
--rm=true --no-cache \
Expand All @@ -110,7 +132,7 @@ gerbilxx:
--build-arg shared="no" \
-t final $(ROOT_DIR) \
--progress=plain
docker tag final gerbil/gerbilxx:$(arch)
docker tag final gerbil/gerbilxx:$(arch)-$(BRANCH)

gerbil:
docker build --target final \
Expand All @@ -124,7 +146,7 @@ gerbil:
--build-arg shared="no" \
-t final $(ROOT_DIR) \
--progress=plain
docker tag final gerbil/gerbil:$(arch)
docker tag final gerbil/gerbil:$(arch)-$(BRANCH)

amazonlinux:
docker build --target final \
Expand All @@ -139,7 +161,7 @@ amazonlinux:
--build-arg shared="yes" \
--build-arg with_db="YES" \
-t final $(ROOT_DIR)
docker tag final gerbil/amazonlinux:$(arch)
docker tag final gerbil/amazonlinux:$(arch)-$(BRANCH)

centos:
docker build --target final \
Expand All @@ -154,11 +176,10 @@ centos:
--build-arg shared="yes" \
--build-arg with_db="YES" \
-t final $(ROOT_DIR)
docker tag final gerbil/centos:$(arch)
docker tag final gerbil/centos:$(arch)-$(BRANCH)

fedora:
docker build --target final \
--rm=true --no-cache \
--build-arg branch="$(BRANCH)" \
--build-arg configure_args="--enable-c++ --enable-march=" \
--build-arg cores=$(cores) \
Expand All @@ -170,7 +191,7 @@ fedora:
--build-arg with_db="YES" \
-t final $(ROOT_DIR) \
--progress=plain
docker tag final gerbil/fedora:$(arch)
docker tag final gerbil/fedora:$(arch)-$(BRANCH)

ubuntu:
docker build --target final \
Expand All @@ -186,7 +207,23 @@ ubuntu:
--build-arg with_db="YES" \
-t final $(ROOT_DIR) \
--progress=plain
docker tag final gerbil/ubuntu:$(arch)
docker tag final gerbil/ubuntu:$(arch)-$(BRANCH)

debian:
docker build --target final \
--rm=true --no-cache \
--build-arg branch="$(BRANCH)" \
--build-arg configure_args="--enable-c++ --enable-march=" \
--build-arg cores=$(cores) \
--build-arg distro="debian" \
--build-arg gerbil_version=$(GERBIL_VERSION) \
--build-arg packages="$(debian_packages)" \
--build-arg repo="$(REPO)" \
--build-arg shared="yes" \
--build-arg with_db="YES" \
-t final $(ROOT_DIR) \
--progress=plain
docker tag final gerbil/ubuntu:$(arch)-$(BRANCH)

ubuntu-current-jedi:
docker build --rm=true --no-cache -t ubuntu-current-jedi $(ROOT_DIR)/ubuntu-current-jedi
Expand Down

0 comments on commit 3e0b206

Please sign in to comment.