Skip to content

Commit 0172523

Browse files
authored
Build Dockerfile.ci using Github workflows (#325)
We have to build and push the docker image used in CI manually. This PR builds that image automatically and pushes it to Github docker repository. Will start using that image in a follow PR
1 parent c69f461 commit 0172523

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: publish-ci-docker-image
2+
on:
3+
push:
4+
branches: [ main ]
5+
jobs:
6+
publish-ci-docker-image:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Login to GitHub Container Registry
11+
uses: docker/login-action@v1
12+
with:
13+
registry: ghcr.io
14+
username: ${{ github.actor }}
15+
password: ${{ secrets.GITHUB_TOKEN }}
16+
- name: Build CI Docker image
17+
run: |
18+
docker build . -f Dockerfile.ci --tag ghcr.io/levkk/pgcat-ci:latest
19+
docker run ghcr.io/levkk/pgcat-ci:latest
20+
docker push ghcr.io/levkk/pgcat-ci:latest

Dockerfile.ci

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
FROM cimg/rust:1.62.0
22
RUN sudo apt-get update && \
3-
sudo apt-get install -y psmisc postgresql-contrib-12 postgresql-client-12 ruby ruby-dev libpq-dev python3 python3-pip lcov llvm-11 && \
4-
sudo apt-get upgrade curl
5-
RUN cargo install cargo-binutils rustfilt && \
6-
rustup component add llvm-tools-preview
7-
RUN pip3 install psycopg2 && \
8-
sudo gem install bundler
9-
RUN wget -O toxiproxy-2.4.0.deb https://github.com/Shopify/toxiproxy/releases/download/v2.4.0/toxiproxy_2.4.0_linux_$(dpkg --print-architecture).deb && \
3+
sudo apt-get install -y \
4+
postgresql-contrib-12 postgresql-client-12 libpq-dev \
5+
ruby ruby-dev python3 python3-pip \
6+
lcov llvm-11 iproute2 && \
7+
sudo apt-get upgrade curl && \
8+
cargo install cargo-binutils rustfilt && \
9+
rustup component add llvm-tools-preview && \
10+
pip3 install psycopg2 && sudo gem install bundler && \
11+
wget -O toxiproxy-2.4.0.deb https://github.com/Shopify/toxiproxy/releases/download/v2.4.0/toxiproxy_2.4.0_linux_$(dpkg --print-architecture).deb && \
1012
sudo dpkg -i toxiproxy-2.4.0.deb

0 commit comments

Comments
 (0)