Skip to content

Commit

Permalink
Docker image building improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
stickz committed Dec 21, 2023
1 parent 47ce856 commit 764d11b
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ on:
- '*'
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'

env:
DOCKERHUB_SLUG: crazymax/rtorrent-rutorrent
Expand Down
111 changes: 111 additions & 0 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: pull

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
paths-ignore:
- '**.md'

jobs:
build_amd64:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v4
with:
files: |
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
targets: image-amd64

build_arm64:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v4
with:
files: |
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
targets: image-arm64

build_arm_v6:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v4
with:
files: |
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
targets: image-arm-v6

build_arm_v7:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build
uses: docker/bake-action@v4
with:
files: |
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
targets: image-arm-v7
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ RUN tree ${DIST_PATH}

WORKDIR /usr/local/src/cares
COPY --from=src-cares /src .
RUN ./configure
RUN ./configure --disable-tests
RUN make -j$(nproc) CFLAGS="-O2 -flto"
RUN make install -j$(nproc)
RUN make DESTDIR=${DIST_PATH} install -j$(nproc)
Expand All @@ -136,7 +136,7 @@ RUN ./configure \
--disable-wininet-client \
--disable-libwww-client
RUN make -j$(nproc)
RUN make install -j$(nproc) CXXFLAGS="-flto"
RUN make install -j$(nproc) CXXFLAGS="-w -flto"
RUN make DESTDIR=${DIST_PATH} install -j$(nproc)
RUN tree ${DIST_PATH}

Expand All @@ -148,7 +148,7 @@ RUN ./autogen.sh
RUN ./configure \
--with-posix-fallocate
RUN make -j$(nproc)
RUN make install -j$(nproc) CXXFLAGS="-O2 -flto"
RUN make install -j$(nproc) CXXFLAGS="-w -O2 -flto"
RUN make DESTDIR=${DIST_PATH} install -j$(nproc)
RUN tree ${DIST_PATH}

Expand All @@ -165,7 +165,7 @@ RUN ./autogen.sh
RUN ./configure \
--with-xmlrpc-c \
--with-ncurses
RUN make -j$(nproc) CXXFLAGS="-O2 -flto"
RUN make -j$(nproc) CXXFLAGS="-w -O2 -flto"
RUN make install -j$(nproc)
RUN make DESTDIR=${DIST_PATH} install -j$(nproc)
RUN tree ${DIST_PATH}
Expand Down
28 changes: 28 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,31 @@ target "image-all" {
"linux/arm64"
]
}

target "image-amd64" {
inherits = ["image"]
platforms = [
"linux/amd64"
]
}

target "image-arm64" {
inherits = ["image"]
platforms = [
"linux/arm64"
]
}

target "image-arm-v6" {
inherits = ["image"]
platforms = [
"linux/arm/v6"
]
}

target "image-arm-v7" {
inherits = ["image"]
platforms = [
"linux/arm/v7"
]
}

0 comments on commit 764d11b

Please sign in to comment.