From 3f2fd915cf166509bc099cc778e635fd4cbaf7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20K=C3=BCffner?= Date: Fri, 8 Jul 2022 09:58:25 +0200 Subject: [PATCH] Revert "switch to official mainsail docker image" This reverts commit 9a89171aea1d7a7a174c0ea78789cd1dcd808876. --- .github/workflows/mainsail.yaml | 13 +++++++++ README.md | 4 ++- docker-compose.yaml | 2 +- docker/mainsail/Dockerfile | 19 +++++++++++++ docker/mainsail/README.md | 48 +++++++++++++++++++++++++++++++++ 5 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/mainsail.yaml create mode 100644 docker/mainsail/Dockerfile create mode 100644 docker/mainsail/README.md diff --git a/.github/workflows/mainsail.yaml b/.github/workflows/mainsail.yaml new file mode 100644 index 0000000..a051a6e --- /dev/null +++ b/.github/workflows/mainsail.yaml @@ -0,0 +1,13 @@ +name: 'Image: Mainsail' +on: + workflow_dispatch: + schedule: + - cron: '0 2 * * *' +jobs: + build: + uses: mkuf/prind/.github/workflows/image-workflow.yaml@main + with: + app: mainsail + secrets: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file diff --git a/README.md b/README.md index c14dfa0..6b1da53 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ # prind [![Image: Klipper](https://github.com/mkuf/prind/actions/workflows/klipper.yaml/badge.svg)](https://github.com/mkuf/prind/actions/workflows/klipper.yaml) [![Image: Moonraker](https://github.com/mkuf/prind/actions/workflows/moonraker.yaml/badge.svg)](https://github.com/mkuf/prind/actions/workflows/moonraker.yaml) +[![Image: Mainsail](https://github.com/mkuf/prind/actions/workflows/mainsail.yaml/badge.svg)](https://github.com/mkuf/prind/actions/workflows/mainsail.yaml) [![Image: Klipperscreen](https://github.com/mkuf/prind/actions/workflows/klipperscreen.yaml/badge.svg)](https://github.com/mkuf/prind/actions/workflows/klipperscreen.yaml) [![Image: Ustreamer](https://github.com/mkuf/prind/actions/workflows/ustreamer.yaml/badge.svg)](https://github.com/mkuf/prind/actions/workflows/ustreamer.yaml) @@ -12,7 +13,7 @@ With a single Command, you can start up klipper and choose between multiple Fron Currently supported Frontends: * Octoprint (via [Dockerhub](https://hub.docker.com/r/octoprint/octoprint)) * Fluidd (via [Dockerhub](https://hub.docker.com/r/cadriel/fluidd)) - * Mainsail (via [GHCR](https://github.com/mainsail-crew/mainsail/pkgs/container/mainsail)) + * Mainsail * KlipperScreen Depending on which Frontend you've chosen, moonraker will also be deployed. @@ -63,6 +64,7 @@ In this example, the Webcam is using device ``/dev/video0``. Do not edit any oth - "traefik.http.routers.webcam.middlewares=webcam" ``` + ### Configuring Klipper/Moonraker All Runtime Configs are stored within ``config`` of this Repo. * Update config/printer.cfg with your Klipper config, make sure to not remove the existing Macros as they are required by fluidd/mainsail. See [Klipper3d Docs](https://www.klipper3d.org/Config_Reference.html) for Reference diff --git a/docker-compose.yaml b/docker-compose.yaml index f462dd2..b368cdf 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -117,7 +117,7 @@ services: - "traefik.http.routers.fluidd.entrypoints=web" mainsail: - image: ghcr.io/mainsail-crew/mainsail:edge + image: mkuf/mainsail:latest restart: unless-stopped profiles: - mainsail diff --git a/docker/mainsail/Dockerfile b/docker/mainsail/Dockerfile new file mode 100644 index 0000000..645b25a --- /dev/null +++ b/docker/mainsail/Dockerfile @@ -0,0 +1,19 @@ +## Get Code and build App +FROM --platform=$BUILDPLATFORM node:16 as build + +ARG REPO=https://github.com/mainsail-crew/mainsail +ARG VERSION=develop + +RUN git clone ${REPO} /opt/mainsail \ + && cd /opt/mainsail \ + && git checkout ${VERSION} + +WORKDIR /opt/mainsail +RUN npm install \ + && ./node_modules/vite/bin/vite.js build + +## Runtime Image +FROM nginx:alpine as run + +COPY --from=build /opt/mainsail/dist /usr/share/nginx/html +RUN chown -R nginx:nginx /usr/share/nginx/html diff --git a/docker/mainsail/README.md b/docker/mainsail/README.md new file mode 100644 index 0000000..ff244cf --- /dev/null +++ b/docker/mainsail/README.md @@ -0,0 +1,48 @@ +# Mainsail packaged in Docker +## What is Mainsail? + +>Mainsail makes Klipper more accessible by adding a lightweight, responsive web user interface, centred around an intuitive and consistent design philosophy. + +_via https://docs.mainsail.xyz/_ + +## Usage +#### Run +```bash +docker run -p 80:80 mkuf/mainsail:latest +``` +#### Compose +```yaml +services: + mainsail: + image: mkuf/mainsail:latest + ports: + - "80:80" +``` + +## Defaults +|Entity|Description| +|---|---| +|User| `nginx (101:101)` | +|Workdir|| +|Entrypoint|`/docker-entrypoint.sh`| +|Cmd|`nginx -g daemon off;`| + +## Ports +|Port|Description| +|---|---| +|`80/tcp`|Default HTTP Port| + +## Volumes +none + +## Tags +|Tag|Description|Static| +|---|---|---| +|`latest`/`nightly`|Refers to the most recent runtime Image.|May point to a new build within 24h, depending on code changes in the upstream repository.| +|`<7-digit-sha>`
eg: `1e0645b`|Refers to a specific commit SHA in the upstream repository. eg: [mainsail-crew/mainsail:1e0645b](https://github.com/mainsail-crew/mainsail/commit/1e0645be6e54abed1e30d54830511ae8f1fad54c)|Yes| + +## Targets +|Target|Description|Pushed| +|---|---|---| +|`build`|Pull Upstream Codebase and build application|No| +|`run`|Default runtime Image based on `library/nginx`|Yes| \ No newline at end of file