-
Notifications
You must be signed in to change notification settings - Fork 130
72 lines (64 loc) · 4.18 KB
/
postgres.yml
File metadata and controls
72 lines (64 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: postgres
on:
push:
paths:
- '.github/workflows/postgres.yml'
workflow_dispatch:
env:
ALPINE_VER: 3.21
jobs:
job1:
name: buildx tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: download postgres src
run: |
sudo apt-get update
sudo apt-get install git
git clone https://github.com/docker-library/postgres.git
sed -i 's/llvm19/llvm15/g' postgres/14/alpine3.21/Dockerfile
sed -i 's/clang19/clang15/g' postgres/14/alpine3.21/Dockerfile
sed -i 's/clang-19/clang-15/g' postgres/14/alpine3.21/Dockerfile
sed -i 's/coreutils/coreutils patch/g' postgres/14/alpine3.21/Dockerfile
sed -i 's/^ENV.*PG_VERSION.*/ENV PG_VERSION 14.1/g' postgres/14/alpine3.21/Dockerfile
sed -i 's/^ENV.*PG_SHA256.*/ENV PG_SHA256 4d3c101ea7ae38982f06bdc73758b53727fb6402ecd9382006fa5ecc7c2ca41f/g' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < postgresql-14-xml-2.12.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/postgresql-14-xml-2.12.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < postgresql.git-99e4d24a9d77e7bb87e15b318e96dc36651a7da2.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/postgresql.git-99e4d24a9d77e7bb87e15b318e96dc36651a7da2.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < v1-0001-WIP-jit-LLVM-15-Minimal-changes.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/v1-0001-WIP-jit-LLVM-15-Minimal-changes.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < postgresql.git-0052fb489008a68d0f3e0445f52e1ab3166632a4.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/postgresql.git-0052fb489008a68d0f3e0445f52e1ab3166632a4.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < llvm14-support.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/llvm14-support.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ patch -p1 < 0001-Replace-uses-of-deprecated-Python-module-distutils.s.patch; \\ ' postgres/14/alpine3.21/Dockerfile
sed -i '/cd \/usr\/src\/postgresql; \\/a\\ \ \ \ wget https://raw.githubusercontent.com/gshang2017/docker/master/tt-rss-plugins/postgresql/patches/0001-Replace-uses-of-deprecated-Python-module-distutils.s.patch; \\ ' postgres/14/alpine3.21/Dockerfile
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: latest
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./postgres/14/alpine3.21
file: ./postgres/14/alpine3.21/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
ghcr.io/gshang2017/postgres:latest
ghcr.io/gshang2017/postgres:14.1-alpine-${{ env.ALPINE_VER }}