Skip to content

Commit

Permalink
Merge pull request #127 from cole-miller/docker-publish
Browse files Browse the repository at this point in the history
Add Dockerfile and GHCR publish workflow
  • Loading branch information
cole-miller authored Aug 17, 2023
2 parents c9a178a + f29748b commit 558bf21
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish container image to GHCR

on:
push:
branches:
- 'master'
paths:
- 'image-version'
- 'Dockerfile'

jobs:
publish:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: GHCR login
uses: docker/login-action@v2
with:
registry: 'ghcr.io'
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: |
version=$(cat image-version)
docker build -t ghcr.io/canonical/jepsen-dqlite-unofficial:$version .
- name: Push
run: |
version=$(cat image-version)
docker push ghcr.io/canonical/jepsen-dqlite-unofficial:$version
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ name: Dqlite Jepsen tests - expected pass

on:
push:
paths-ignore:
- 'image-version'
- 'Dockerfile'
pull_request:
paths-ignore:
- 'image-version'
- 'Dockerfile'
schedule:
- cron: '0 0 * * *'
- cron: '0 */1 * * *'
workflow_dispatch:
inputs:
raft-repo:
Expand Down
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM ubuntu:jammy

ARG GO_VERSION=1.21.0

RUN apt-get update
RUN apt-get install --yes --no-install-recommends \
automake \
build-essential \
curl \
git \
gnuplot-nox \
graphviz \
iproute2 \
iptables \
leiningen \
libjna-java \
liblz4-dev \
libsqlite3-dev \
libtool \
libuv1-dev \
pkg-config \
sudo

WORKDIR /root
RUN git clone --depth 1 https://github.com/ianlancetaylor/libbacktrace

WORKDIR /root/libbacktrace
RUN autoreconf -i
RUN ./configure
RUN make install

WORKDIR /root
RUN rm -rf libbacktrace
RUN curl -L -o go.tar.gz https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz
RUN tar xzf go.tar.gz
RUN mv go /usr/local
RUN rm -f go.tar.gz
1 change: 1 addition & 0 deletions image-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.0.1

0 comments on commit 558bf21

Please sign in to comment.