Skip to content

Commit

Permalink
Change base image to kasmvnc (sytone#55)
Browse files Browse the repository at this point in the history
* Update dependencies

* Update Obsidian version for the ARM64 Dockerfile

* Update the AMD64 Dockerfile with Kasm VNC

* Update README for new Ports and Environment vars

* Add forgotten healthcheck to Dockerfiles

* Fix icon path for Obsidian in context menu
  • Loading branch information
ArnoldDeRuiter authored May 18, 2023
1 parent 8d92f3f commit 3b49c2f
Show file tree
Hide file tree
Showing 9 changed files with 125 additions and 157 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')"

- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/obsidian-remote
tags: |
Expand All @@ -35,17 +35,17 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: .
#file: ./Dockerfile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote
- name: Build and push Docker images
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
file: dockerfile.amd64
Expand All @@ -64,7 +64,7 @@ jobs:
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/obsidian-remote:buildcache_amd64,mode=max

- name: Build and push Docker images
uses: docker/build-push-action@v3
uses: docker/build-push-action@v4
with:
context: .
file: dockerfile.arm64
Expand Down
86 changes: 35 additions & 51 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,55 +1,39 @@
FROM ghcr.io/linuxserver/baseimage-rdesktop-web:focal

LABEL org.opencontainers.image.authors="github@sytone.com"
LABEL org.opencontainers.image.source="https://github.com/sytone/obsidian-remote"
LABEL org.opencontainers.image.title="Container hosted Obsidian MD"
LABEL org.opencontainers.image.description="Hosted Obsidian instance allowing access via web browser"

RUN \
echo "**** install packages ****" && \
# Update and install extra packages.
apt-get update && \
apt-get install -y --no-install-recommends \
# Packages needed to download and extract obsidian.
curl \
libnss3 \
# Install Chrome dependencies.
dbus-x11 \
uuid-runtime && \
echo "**** cleanup ****" && \
apt-get autoclean && \
rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/*

# set version label
ARG OBSIDIAN_VERSION=0.15.9

RUN \
echo "**** download obsidian ****" && \
curl \
https://github.com/obsidianmd/obsidian-releases/releases/download/v$OBSIDIAN_VERSION/Obsidian-$OBSIDIAN_VERSION.AppImage \
-L \
-o obsidian.AppImage

RUN \
echo "**** extract obsidian ****" && \
chmod +x /obsidian.AppImage && \
/obsidian.AppImage --appimage-extract

ENV \
CUSTOM_PORT="8080" \
GUIAUTOSTART="true" \
HOME="/vaults" \
TITLE="Obsidian v$OBSIDIAN_VERSION"

# add local files
FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbullseye

LABEL maintainer="github@sytone.com" \
org.opencontainers.image.authors="github@sytone.com" \
org.opencontainers.image.source="https://github.com/sytone/obsidian-remote" \
org.opencontainers.image.title="Container hosted Obsidian MD" \
org.opencontainers.image.description="Hosted Obsidian instance allowing access via web browser"

# Update and install extra packages.
RUN echo "**** install packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends curl libgtk-3-0 libnotify4 libatspi2.0-0 libsecret-1-0 libnss3 desktop-file-utils && \
apt-get autoclean && rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*

# Set version label
ARG OBSIDIAN_VERSION=1.2.8

# Download and install Obsidian
RUN echo "**** download obsidian ****" && \
curl --location --output obsidian.deb "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian_${OBSIDIAN_VERSION}_amd64.deb" && \
dpkg -i obsidian.deb

# Environment variables
ENV CUSTOM_PORT="8080" \
CUSTOM_HTTPS_PORT="8443" \
CUSTOM_USER="" \
PASSWORD="" \
SUBFOLDER="" \
TITLE="Obsidian v${OBSIDIAN_VERSION}" \
FM_HOME="/vaults"

# Add local files
COPY root/ /

EXPOSE 8080
EXPOSE 27123
EXPOSE 27124
EXPOSE 8080 8443
VOLUME ["/config","/vaults"]


# Define a healthcheck
HEALTHCHECK CMD curl --fail http://localhost:8080/ || exit 1
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ docker run -d `

| Port | Description |
| ----- | --------------------------------------- |
| 8080 | Obsidian Web Interface |
| 27123 | Local REST API Plugin HTTP Server Port |
| 27124 | Local REST API Plugin HTTPS Server Port |
| 8080 | HTTP Obsidian Web Interface |
| 8443 | HTTPS Obsidian Web Interface |

### Mapped Volumes

Expand All @@ -79,18 +78,25 @@ docker run -d `
| TZ | Set the Time Zone for the container, should match your TZ. `Etc/UTC` by default. See [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for valid options. |
| DOCKER_MODS | Use to add mods to the container like git. E.g. `DOCKER_MODS=linuxserver/mods:universal-git` See [Docker Mods](https://github.com/linuxserver/docker-mods) for details. |
| KEYBOARD | Used to se the keyboard being used for input. E.g. `KEYBOARD=en-us-qwerty` or `KEYBOARD=de-de-qwertz` a list of other possible values (not tested) can be found at <https://github.com/linuxserver/docker-digikam#keyboard-layouts> |
| CUSTOM_PORT | Internal port the container listens on for http if it needs to be swapped from the default 3000. |
| CUSTOM_HTTPS_PORT | Internal port the container listens on for https if it needs to be swapped from the default 3001. |
| CUSTOM_USER | HTTP Basic auth username, abc is default. |
| PASSWORD | HTTP Basic auth password, abc is default. If unset there will be no auth |
| SUBFOLDER | Subfolder for the application if running a subfolder reverse proxy, need both slashes IE `/subfolder/` |
| TITLE | The page title displayed on the web browser, default "KasmVNC Client". |
| FM_HOME | This is the home directory (landing) for the file manager, default "/config". |

## Using Docker Compose

```YAML
version: '3.8'
services:
obsidian:
image: 'ghcr.io/sytone/obsidian-remote:latest'
container_name: obsidian-remote
restart: unless-stopped
ports:
- 8080:8080
- 8443:8443
volumes:
- /home/obsidian/vaults:/vaults
- /home/obsidian/config:/config
Expand All @@ -99,6 +105,11 @@ services:
- PGID=1000
- TZ=America/Los_Angeles
- DOCKER_MODS=linuxserver/mods:universal-git
- CUSTOM_PORT="8080"
- CUSTOM_HTTPS_PORT="8443"
- CUSTOM_USER=""
- PASSWORD=""
- SUBFOLDER=""
```
## Enabling GIT for the obsidian-git plugin
Expand Down Expand Up @@ -213,7 +224,6 @@ Thanks to @fahrenhe1t for this example.
If you install obsidian-remote in Docker, you can proxy it through [Nginx Proxy Manager](https://nginxproxymanager.com/) (NPM - running on the same Docker instance), and use an access list to provide user authentication. The obsidian-remote container would have to be on the same network as Nginx Proxy Manager. If you don't expose the IP external to the container, authentication would be forced through NPM:

```yaml
version: '3.8'
services:
obsidian:
image: 'ghcr.io/sytone/obsidian-remote:latest'
Expand Down
76 changes: 29 additions & 47 deletions dockerfile.amd64
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
FROM ghcr.io/linuxserver/baseimage-rdesktop-web:focal
RUN \
echo "**** install packages ****" && \
# Update and install extra packages.
apt-get update && \
apt-get install -y --no-install-recommends \
# Explicitly install git. Issue #36
git \
# Packages needed to download and extract obsidian.
curl \
libnss3 \
# Install Chrome dependencies.
dbus-x11 \
uuid-runtime && \
echo "**** cleanup ****" && \
apt-get autoclean && \
rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/*

# set version label
ARG OBSIDIAN_VERSION=1.1.9

RUN \
echo "**** download obsidian ****" && \
curl \
https://github.com/obsidianmd/obsidian-releases/releases/download/v$OBSIDIAN_VERSION/Obsidian-$OBSIDIAN_VERSION.AppImage \
-L \
-o obsidian.AppImage

RUN \
echo "**** extract obsidian ****" && \
chmod +x /obsidian.AppImage && \
/obsidian.AppImage --appimage-extract

ENV \
CUSTOM_PORT="8080" \
GUIAUTOSTART="true" \
HOME="/vaults" \
TITLE="Obsidian v$OBSIDIAN_VERSION"

# add local files
FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbullseye

# Update and install extra packages.
RUN echo "**** install packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends curl libgtk-3-0 libnotify4 libatspi2.0-0 libsecret-1-0 libnss3 desktop-file-utils && \
apt-get autoclean && rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*

# Set version label
ARG OBSIDIAN_VERSION=1.2.8

# Download and install Obsidian
RUN echo "**** download obsidian ****" && \
curl --location --output obsidian.deb "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian_${OBSIDIAN_VERSION}_amd64.deb" && \
dpkg -i obsidian.deb

# Environment variables
ENV CUSTOM_PORT="8080" \
CUSTOM_HTTPS_PORT="8443" \
CUSTOM_USER="" \
PASSWORD="" \
SUBFOLDER="" \
TITLE="Obsidian v${OBSIDIAN_VERSION}" \
FM_HOME="/vaults"

# Add local files
COPY root/ /

EXPOSE 8080
EXPOSE 27123
EXPOSE 27124
EXPOSE 8080 8443
VOLUME ["/config","/vaults"]


# Define a healthcheck
HEALTHCHECK CMD curl --fail http://localhost:8080/ || exit 1
78 changes: 35 additions & 43 deletions dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -1,51 +1,43 @@
FROM ghcr.io/linuxserver/baseimage-rdesktop-web:focal
RUN \
echo "**** install packages ****" && \
# Update and install extra packages.
apt-get update && \
apt-get install -y --no-install-recommends \
# Explicitly install git. Issue #36
git \
# Packages needed to download and extract obsidian.
curl \
libnss3 \
zlib1g-dev \
# Install Chrome dependencies.
dbus-x11 \
uuid-runtime && \
echo "**** cleanup ****" && \
apt-get autoclean && \
rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/*
FROM ghcr.io/linuxserver/baseimage-rdesktop-web:focal-20210824

# set version label
ARG OBSIDIAN_VERSION=1.1.9
ARG OBSIDIAN_VERSION=1.2.8
ARG ARCH=arm64

RUN \
echo "**** download obsidian ****" && \
# Update and install extra packages.
RUN echo "**** install packages ****" && \
apt-get update && \
apt-get install -y --no-install-recommends \
git \
curl \
https://github.com/obsidianmd/obsidian-releases/releases/download/v$OBSIDIAN_VERSION/Obsidian-1.1.9-arm64.AppImage -o obsidian.AppImage

RUN \
echo "**** extract obsidian ****" && \
chmod +x /obsidian.AppImage && \
/obsidian.AppImage --appimage-extract

ENV \
CUSTOM_PORT="8080" \
GUIAUTOSTART="true" \
HOME="/vaults" \
TITLE="Obsidian v$OBSIDIAN_VERSION"

# add local files
libnss3 \
zlib1g-dev \
dbus-x11 \
uuid-runtime && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*

# Download and install Obsidian
RUN echo "**** download obsidian ****" && \
curl -L -o /obsidian.AppImage \
"https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/Obsidian-${OBSIDIAN_VERSION}-${ARCH}.AppImage" && \
chmod +x /obsidian.AppImage && \
/obsidian.AppImage --appimage-extract

# Environment variables
ENV CUSTOM_PORT="8080" \
CUSTOM_HTTPS_PORT="8443" \
CUSTOM_USER="" \
PASSWORD="" \
SUBFOLDER="" \
TITLE="Obsidian v$OBSIDIAN_VERSION" \
FM_HOME="/vaults"

# Add local files
COPY root/ /

EXPOSE 8080
EXPOSE 27123
EXPOSE 27124
# Expose ports and volumes
EXPOSE 8080 27123 27124
VOLUME ["/config","/vaults"]


# Define a healthcheck
HEALTHCHECK CMD curl --fail http://localhost:8080/ || exit 1
2 changes: 1 addition & 1 deletion root/defaults/autostart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer
sudo /usr/bin/obsidian --no-sandbox
4 changes: 2 additions & 2 deletions root/defaults/menu.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<openbox_menu xmlns="http://openbox.org/3.4/menu">
<menu id="root-menu" label="MENU">
<item label="Obsidian" icon="/squashfs-root/usr/share/icons/hicolor/48x48/apps/obsidian.png">
<item label="Obsidian" icon="/usr/share/icons/hicolor/48x48/apps/obsidian.png">
<action name="Execute">
<command>/squashfs-root/obsidian --no-sandbox --disable-dev-shm-usage --disable-gpu --disable-software-rasterizer</command>
<command>sudo /usr/bin/obsidian --no-sandbox</command>
</action>
</item>
<item label="xterm" icon="/usr/share/pixmaps/xterm-color_48x48.xpm">
Expand Down
2 changes: 1 addition & 1 deletion root/etc/cont-init.d/50-config
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ echo "********************************"
chown -R abc:abc \
/config \
/vaults \
/squashfs-root
/root

0 comments on commit 3b49c2f

Please sign in to comment.