Skip to content

Commit 0078d43

Browse files
JuniorJPDJqu1ck
authored andcommitted
feat: docker containerization and example docker-compose
1 parent cc3e595 commit 0078d43

File tree

6 files changed

+137
-1
lines changed

6 files changed

+137
-1
lines changed

.dockerignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.vscode
2+
.idea
3+
test
4+
objectdb
5+
venv/
6+
log.txt
7+
benchmark
8+
renovate.json
9+
README.md
10+
.travis.yml
11+
.github
12+
.flake8
13+
.gitignore
14+
.git

.github/workflows/docker-publish.yml

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Docker build
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
workflow_dispatch:
8+
9+
env:
10+
# Use docker.io for Docker Hub if empty
11+
REGISTRY: ghcr.io
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
# This is used to complete the identity challenge
20+
# with sigstore/fulcio when running outside of PRs.
21+
id-token: write
22+
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
26+
27+
# Workaround: https://github.com/docker/build-push-action/issues/461
28+
- name: Setup Docker buildx
29+
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3
30+
31+
- name: Log into registry ${{ env.REGISTRY }}
32+
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3
33+
with:
34+
registry: ${{ env.REGISTRY }}
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Extract Docker metadata
39+
id: meta
40+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
41+
with:
42+
images: ${{ env.REGISTRY }}/${{ github.repository }}
43+
tags: |
44+
type=schedule
45+
type=ref,event=branch
46+
type=ref,event=tag
47+
type=raw,value=latest,enable={{is_default_branch}}
48+
49+
- name: Build and push Docker image
50+
id: build-and-push
51+
uses: docker/build-push-action@31159d49c0d4756269a0940a750801a1ea5d7003 # v6
52+
with:
53+
context: .
54+
push: true
55+
platforms: linux/amd64,linux/386,linux/arm/v6,linux/arm/v7,linux/arm64
56+
tags: ${{ steps.meta.outputs.tags }}
57+
labels: ${{ steps.meta.outputs.labels }}
58+
cache-from: type=gha
59+
cache-to: type=gha,mode=max

Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM python:3.12.4-alpine@sha256:dc095966439c68283a01dde5e5bc9819ba24b28037dddd64ea224bf7aafc0c82
2+
3+
# renovate: datasource=repology depName=alpine_3_20/fuse versioning=loose
4+
ARG FUSE_VERSION="2.9.9-r5"
5+
6+
WORKDIR /app
7+
8+
ADD requirements.txt .
9+
10+
RUN apk add --no-cache \
11+
fuse=${FUSE_VERSION} \
12+
&& \
13+
sed -i 's/#user_allow_other/user_allow_other/g' /etc/fuse.conf && \
14+
pip install -r requirements.txt && \
15+
rm -rf /root/.cache /root/.cargo
16+
17+
COPY --chown=nobody:nogroup . .
18+
19+
USER nobody
20+
ENV FUSE_LIBRARY_PATH=/usr/lib/libfuse.so.2
21+
22+
ENTRYPOINT [ "python", "./ziprofs.py" ]

docker-compose.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
services:
2+
ziprofs:
3+
# build: .
4+
image: ghcr.io/openscopeproject/ziprofs
5+
privileged: true
6+
volumes:
7+
- # Root/source directory
8+
source: ./data/root
9+
target: /app/root
10+
type: bind
11+
- # Mountpoint/target directory
12+
source: ./data/mnt
13+
target: /app/mnt
14+
type: bind
15+
bind:
16+
propagation: rshared
17+
command:
18+
- /app/root
19+
- /app/mnt
20+
- -o
21+
- allowother,foreground

renovate.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:best-practices",
5+
":semanticCommits",
6+
":semanticCommitScopeDisabled",
7+
"docker:enableMajor",
8+
"customManagers:dockerfileVersions"
9+
],
10+
"packageRules": [
11+
{
12+
"description": "Group OS packages to avoid build errors if more than one package is updated and previous version is not present in repo already",
13+
"matchDatasources": [
14+
"repology"
15+
],
16+
"groupName": "OS Packages"
17+
}
18+
],
19+
"forkProcessing": "enabled"
20+
}

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
fusepy
1+
fusepy==3.0.1

0 commit comments

Comments
 (0)