Skip to content

Commit b4080d4

Browse files
aclerici38onedr0p
andauthored
feat: add octoprint (#1064)
Co-authored-by: Devin Buhl <onedr0p@users.noreply.github.com>
1 parent 0533f26 commit b4080d4

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

apps/octoprint/Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# syntax=docker/dockerfile:1
2+
3+
FROM docker.io/library/python:3.13-alpine3.22
4+
ARG VENDOR
5+
ARG VERSION
6+
7+
ENV \
8+
CRYPTOGRAPHY_DONT_BUILD_RUST=1 \
9+
PIP_BREAK_SYSTEM_PACKAGES=1 \
10+
PIP_DISABLE_PIP_VERSION_CHECK=1 \
11+
PIP_NO_CACHE_DIR=1 \
12+
PIP_ROOT_USER_ACTION=ignore \
13+
PYTHONDONTWRITEBYTECODE=1 \
14+
PYTHONUNBUFFERED=1 \
15+
UV_NO_CACHE=true \
16+
UV_SYSTEM_PYTHON=true \
17+
UV_EXTRA_INDEX_URL="https://wheel-index.linuxserver.io/alpine-3.22/" \
18+
# https://community.octoprint.org/t/trouble-with-installing-netifaces-on-alpine-linux/61694
19+
# Maybe can be removed in v1.12
20+
CFLAGS="-Wno-int-conversion"
21+
22+
USER root
23+
24+
RUN \
25+
apk add --no-cache \
26+
catatonit \
27+
ffmpeg \
28+
&& apk add --no-cache --virtual .build-deps \
29+
build-base \
30+
linux-headers \
31+
&& pip install uv \
32+
&& uv pip install octoprint==${VERSION} \
33+
&& pip uninstall --yes uv \
34+
&& apk del --purge .build-deps \
35+
&& rm -rf /root/.cache /root/.cargo /tmp/*
36+
37+
USER nobody:nogroup
38+
WORKDIR /config
39+
40+
# Plugins need to use 'pip install --user'
41+
ENV PYTHONUSERBASE=/config/plugins \
42+
PIP_USER=true
43+
44+
ENTRYPOINT ["/usr/bin/catatonit", "--", "octoprint", "serve", "--basedir", "/config"]

apps/octoprint/container_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package main
2+
3+
import (
4+
"context"
5+
"testing"
6+
7+
"github.com/home-operations/containers/testhelpers"
8+
)
9+
10+
func Test(t *testing.T) {
11+
ctx := context.Background()
12+
image := testhelpers.GetTestImage("ghcr.io/home-operations/octoprint:rolling")
13+
testhelpers.TestHTTPEndpoint(t, ctx, image, testhelpers.HTTPTestConfig{Port: "5000"}, nil)
14+
}

apps/octoprint/docker-bake.hcl

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
target "docker-metadata-action" {}
2+
3+
variable "APP" {
4+
default = "octoprint"
5+
}
6+
7+
variable "VERSION" {
8+
// renovate: datasource=pypi depName=OctoPrint
9+
default = "1.11.5"
10+
}
11+
12+
variable "SOURCE" {
13+
default = "https://github.com/OctoPrint/OctoPrint"
14+
}
15+
16+
group "default" {
17+
targets = ["image-local"]
18+
}
19+
20+
target "image" {
21+
inherits = ["docker-metadata-action"]
22+
args = {
23+
VERSION = "${VERSION}"
24+
}
25+
labels = {
26+
"org.opencontainers.image.source" = "${SOURCE}"
27+
}
28+
}
29+
30+
target "image-local" {
31+
inherits = ["image"]
32+
output = ["type=docker"]
33+
tags = ["${APP}:${VERSION}"]
34+
}
35+
36+
target "image-all" {
37+
inherits = ["image"]
38+
platforms = [
39+
"linux/amd64",
40+
"linux/arm64"
41+
]
42+
}

0 commit comments

Comments
 (0)