new: docker workflow
All checks were successful
Build docker image / build (push) Successful in 29s

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn 2025-01-28 10:11:38 +03:00
parent 7cc249aac6
commit a394df6210
Signed by: ngn
GPG Key ID: A3654DF5AD9F641D
3 changed files with 43 additions and 11 deletions

View File

@ -0,0 +1,28 @@
name: Build docker image
on:
push:
branches: ["main"]
env:
REGISTRY: git.matterlinux.xyz
IMAGE: ${{gitea.repository}}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: "https://github.com/actions/checkout@v4"
- name: Login to container repo
uses: "https://github.com/docker/login-action@v1"
with:
registry: ${{env.REGISTRY}}
username: ${{gitea.actor}}
password: ${{secrets.PACKAGES_TOKEN}}
- name: Build image
run: |
docker build --tag ${{env.REGISTRY}}/${{env.IMAGE}}:latest .
docker push ${{env.REGISTRY}}/${{env.IMAGE}}:latest

View File

@ -1,4 +1,4 @@
FROM libmp as build
FROM git.matterlinux.xyz/matter/libmp as build
RUN apt update
RUN apt install -y make gcc gettext libinih-dev libsqlite3-dev libarchive-dev
@ -13,7 +13,7 @@ COPY ./src ./src
RUN make
RUN make install
FROM libmp as main
FROM git.matterlinux.xyz/matter/libmp as main
RUN apt update
RUN apt install -y dumb-init
@ -26,4 +26,9 @@ COPY --from=build /usr/share/locale/tr/LC_MESSAGES/pooler.mo /usr/share/locale/t
COPY --from=build /etc/pooler/config.ini /etc/pooler/config.ini
COPY --from=build /usr/bin/pooler /usr/bin/pooler
RUN useradd runner -r -u 1001
RUN chown -R runner:runner /var/lib/pooler
RUN chown -R runner:runner /etc/pooler
USER runner
ENTRYPOINT ["dumb-init", "/usr/bin/pooler", "/etc/pooler/config.ini"]

View File

@ -1,4 +1,7 @@
# pooler | MatterLinux pool server
![](https://git.matterlinux.xyz/matter/pooler/actions/workflows/docker.yml/badge.svg)
Simple MPTP server implementation for serving MatterLinux package pools.
Built on top of [`libmp`](https://git.matterlinux.xyz/Matter/libmp).
@ -18,8 +21,7 @@ After installing these dependencies, you should download the latest release.
If you are building this program for development purposes, then you may also
build from the latest commit. However latest commit may not always be compilable.
After obtaining the source code, you can compile the program using the make
tool:
After obtaining the source code, you can compile the program using the make tool:
```bash
make
```
@ -36,17 +38,14 @@ docker build --tag pooler .
And for deployment you can use docker-compose, here is an example configuration:
```yaml
version: "3"
services:
pooler:
image: pooler
build:
context: ./
container_name: pooler
image: git.matterlinux.xyz/matter/pooler
ports:
- "5858:5858/tcp"
- "5858:5858/tcp"
volumes:
- "./config.ini:/etc/pooler/config.ini"
- "./config.ini:/etc/pooler/config.ini"
```
Just make sure you read the compose file and place the configuration file and the pools
to the right place: