diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6074752..35e3c62 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -7,7 +7,7 @@ name: Docker on: push: - branches: [main] + # branches: [main] # Publish semver tags as releases. tags: ['v*.*.*'] @@ -16,6 +16,10 @@ jobs: runs-on: ubuntu-latest steps: + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H:%M:%S')" + - name: Checkout repository uses: actions/checkout@v2 @@ -36,3 +40,6 @@ jobs: #file: ./Dockerfile push: true # Will only build if this is not here tags: ghcr.io/${{ github.repository_owner }}/obsidian-remote:latest + build-args: | + "BUILD_DATE=${{ steps.date.outputs.date }}" + "IMAGE_VERSION=${{ env.GITHUB_REF_NAME }}" diff --git a/Dockerfile b/Dockerfile index c422d37..edcf589 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,16 @@ FROM ghcr.io/linuxserver/baseimage-rdesktop-web:focal # set version label -ARG BUILD_DATE -ARG VERSION -LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" -LABEL maintainer="github@sytone.com" +ARG BUILD_DATE=unknown +ARG IMAGE_VERSION +ARG OBSIDIAN_VERSION=0.13.31 + +LABEL org.opencontainers.image.authors="github@sytone.com" +LABEL org.opencontainers.image.created="${BUILD_DATE}" +LABEL org.opencontainers.image.source="https://github.com/sytone/obsidian-remote" +LABEL org.opencontainers.image.version="${IMAGE_VERSION}" +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 ****" && \ @@ -22,16 +28,14 @@ RUN \ RUN \ echo "**** download obsidian ****" && \ curl \ - https://github.com/obsidianmd/obsidian-releases/releases/download/v0.13.31/Obsidian-0.13.31.AppImage \ + 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 && \ - mkdir /vaults && \ - chown -R abc:abc /squashfs-root /vaults + /obsidian.AppImage --appimage-extract ENV \ CUSTOM_PORT="8080" \ diff --git a/README.md b/README.md index 3e41889..ddc29b5 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ docker run -d -v D:/ob/vaults:/vaults -v D:/ob/config:/config/.config/obsidian - To build and use it locally run the following commands: ```PowerShell -docker --debug --log-level debug build --progress plain --pull --rm -f "DockerFile" -t obsidian-remote:latest "." +docker build --pull --rm --build-arg BUILD_DATE=$(date -uformat +"%Y%m%d") -f "Dockerfile" -t obsidian-remote:latest "." ``` To run the localy build image: diff --git a/root/etc/cont-init.d/50-config b/root/etc/cont-init.d/50-config index c9307a5..8a3f029 100644 --- a/root/etc/cont-init.d/50-config +++ b/root/etc/cont-init.d/50-config @@ -16,4 +16,5 @@ fi # permissions chown -R abc:abc \ /config \ - /vaults + /vaults \ + /squashfs-root