Skip to content

Commit

Permalink
Merge pull request #6 from ChrisRomp/2024-01-11b
Browse files Browse the repository at this point in the history
- Fix ARM/v7 builds
- Update docs
  • Loading branch information
ChrisRomp authored Jan 11, 2024
2 parents ab44e6b + a9af425 commit ca5ad3a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ on:
# schedule:
# - cron: '22 23 * * *'
push:
paths-ignore:
- '**/*.md'
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
paths-ignore:
- '**/*.md'
branches: [ "main" ]
workflow_dispatch:

Expand Down Expand Up @@ -78,7 +82,7 @@ jobs:
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
platforms: linux/amd64,linux/arm64 #,linux/arm/v7
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@ RUN apk add curl make g++ libx11-dev perl
RUN mkdir /hamclock
WORKDIR /hamclock

# Download and build HamClock
# Following Desktop build steps from https://www.clearskyinstitute.com/ham/HamClock/
RUN rm -fr ESPHamClock
# Download HamClock source
# Sort-of following Desktop build steps from https://www.clearskyinstitute.com/ham/HamClock/
RUN curl -O https://www.clearskyinstitute.com/ham/HamClock/ESPHamClock.zip && \
unzip ESPHamClock.zip && \
cd ESPHamClock && \
make -j 4 hamclock-web-${HAMCLOCK_RESOLUTION} && \
make install
unzip ESPHamClock.zip
WORKDIR /hamclock/ESPHamClock

# We need to do a little source hacking to cast t_time to a long for the ARM/v7 build to work. I expect to remove this in the near future (already reported to dev).
RUN sed -i '/^ time_t upsecs = getUptime (&days, &hrs, &mins, &secs);$/c\ long upsecs = (long) getUptime (&days, &hrs, &mins, &secs);' ESPHamClock.ino

# Let's build it
RUN make -j 4 hamclock-web-${HAMCLOCK_RESOLUTION}
RUN make install

USER root

Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ Thanks also to Julius Zeidler [@zeidos](https://github.com/zeidlos) for [his wor

## Prerequisites

You will need to have a computer running [Docker](https://docs.docker.com/get-docker/).

**NOTE:** Support for Raspsberry Pi is not yet working but [in progress](https://github.com/ChrisRomp/hamclock-docker/issues/5).
You will need to have a computer running [Docker](https://docs.docker.com/get-docker/). Once installed, you can verify it's running with `docker run --rm hello-world` ([docs](https://hub.docker.com/_/hello-world)).

If you're already lost, may I recommend buying a [prebulit HamClock](https://www.veritiumhfclock.com/)?

Expand All @@ -32,6 +30,16 @@ You can run this app by either by pulling the container from the prebuilt contai

To run containers with Docker you can use the command line `docker run` argument, or use Docker Compose. I find for most users the Docker Compose option is easiest, as it encapuslates all of the arguments in one place in a nice, repeatable manner. This is also the version that some NAS devices expect, like QNAP.

To run:

1. Install [Prerequisites](#prerequisites).
1. (Optional) Create a directory somewhere called hamclock or hamclock-docker.
1. Download [examples/docker-compose.yaml](https://raw.githubusercontent.com/ChrisRomp/hamclock-docker/main/examples/docker-compose.yaml) and save to that folder.
1. Run `docker-compose up -d` from inside of the folder where `docker-compose.yaml` lives.
1. If you didn't receive any errors, see [Accessing HamClock](#accessing-hamclock) below for next steps.

Or you can paste this YAML into a `docker-compose.yaml` file yourself:

```yaml
version: "3"
services:
Expand All @@ -48,7 +56,8 @@ volumes:
data:
```
> **NOTE:** If your Docker host computer is already hosting an application which is using TCP ports `8080` (used by HamClock's API) or `8081` (used by the HamClock web UI), then you can modify them in the `Dockerfile` using the syntax `HOST:CONTAINER`.
> [!NOTE]
> If your Docker host computer is already hosting an application which is using TCP ports `8080` (used by HamClock's API) or `8081` (used by the HamClock web UI), then you can modify them in the `Dockerfile` using the syntax `HOST:CONTAINER`.
>
> For example, to change the web UI from port `8081` to port `80`, you would change the `8081:8081/tcp` port to `80:8081/tcp`.
>
Expand All @@ -74,10 +83,10 @@ docker run --detach -p 8080:8080 -p 8081:8081 --name hamclock -v hamclock:/root/

You can clone or download the source code to this repository, or just copy/paste the contents of the `Dockerfile` into a text file on your local machine called `Dockerfile`.

Then you can copy the contents from `docker-compose-source.yaml` into a file called `docker-compose.yaml` in the same directory as your `Dockerfile`.
Here is a `docker-compose.yaml` file ready to go:

```yaml
version: "3.8"
version: "3"
services:
web:
build:
Expand Down
File renamed without changes.

0 comments on commit ca5ad3a

Please sign in to comment.