Skip to content

Commit

Permalink
update build for versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
sytone committed Mar 14, 2022
1 parent 3f848e5 commit e11aa0f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name: Docker

on:
push:
branches: [main]
# branches: [main]
# Publish semver tags as releases.
tags: ['v*.*.*']

Expand All @@ -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

Expand All @@ -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 }}"
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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="[email protected]"
ARG BUILD_DATE=unknown
ARG IMAGE_VERSION
ARG OBSIDIAN_VERSION=0.13.31

LABEL org.opencontainers.image.authors="[email protected]"
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 ****" && \
Expand All @@ -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" \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion root/etc/cont-init.d/50-config
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ fi
# permissions
chown -R abc:abc \
/config \
/vaults
/vaults \
/squashfs-root

0 comments on commit e11aa0f

Please sign in to comment.