Skip to content

Commit

Permalink
Add image metadata, allow flags to be overridden, and tzdata (#12)
Browse files Browse the repository at this point in the history
That last one was a major omission and would cause the daemon to hang
when run in a container.
  • Loading branch information
kgaughan authored Aug 25, 2024
1 parent c917236 commit 9c4ff14
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
FROM alpine:latest

LABEL org.opencontainers.image.title=NXTP
LABEL org.opencontainers.image.description="An NXTP client and server"
LABEL org.opencontainers.image.vendor="Keith Gaughan"
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.url=https://github.com/kgaughan/nxtp
LABEL org.opencontainers.image.source=https://github.com/kgaughan/nxtp
LABEL org.opencontainers.image.documentation=https://kgaughan.github.io/nxtp/

RUN apk --no-cache add tzdata
COPY nxtp .
USER nobody
EXPOSE 12300
ENTRYPOINT ["/nxtp", "-endpoint", ":12300"]
ENTRYPOINT ["/nxtp"]
CMD ["-endpoint", "0.0.0.0:12300"]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ Restart = on-failure
Under `contrib` is a NetBSD rc script. It expects _daemond_ to be installed
to help daemonise the server, which you can do with `pkgin install daemond`.

## Running under Docker

To start the daemon in a Docker container, run:

```sh
docker run -d -p 12300:12300 ghcr.io/kgaughan/nxtp:latest
```

## Building

Run the following:
Expand Down
12 changes: 12 additions & 0 deletions contrib/nxtp.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description = Network neXt Time Protocol (NXTP) server
After = network.target

[Service]
Type = simple
ExecStart = /usr/bin/nxtp
KillMode = process
RestartSec = 5s
Restart = on-failure

# vi:set ft=dosini:

0 comments on commit 9c4ff14

Please sign in to comment.