Skip to content

Commit b21af97

Browse files
Merge pull request #2 from indigo423/main
feat: Create OCI image from source
2 parents b2014d8 + 9449845 commit b21af97

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Build stage: use Alpine with build tools
2+
FROM alpine:3.22.1 AS builder
3+
4+
WORKDIR /usr/src
5+
6+
RUN apk add --no-cache gcc musl-dev make
7+
8+
COPY ./src .
9+
10+
RUN make release
11+
12+
# Assemble runtime image
13+
FROM alpine:3.22.1
14+
15+
COPY --from=builder /usr/src/mpdirectory .
16+
17+
RUN adduser -D -g "mpdirectory user" mpdirectory
18+
19+
USER mpdirectory
20+
21+
ENTRYPOINT ["/mpdirectory"]
22+
23+
CMD ["-h"]
24+
25+
EXPOSE 27950/udp

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ to compile the debug version
2929
The resulting binary is just called `mpdirectory`
3030

3131
## Docker
32+
33+
Build OCI
34+
```bash
35+
docker build -t mpdirectory .
3236
```
33-
git clone https://github.com/nuclearmonster/mpdirectory_docker
34-
cd mpdirectory
35-
docker compose up -d
36-
```
37+
38+
Running as a container
39+
40+
```bash
41+
docker run --rm -p 27950:27950/udp mpdirectory -f
42+
```

0 commit comments

Comments
 (0)