Skip to content

Commit 5f63c41

Browse files
committed
Updated Dockerfile with build/run containers
1 parent 66eca38 commit 5f63c41

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

Dockerfile

+39-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
1+
# -------------------
2+
# The build container
3+
# -------------------
4+
FROM debian:bookworm-slim AS build
15

2-
FROM debian:bookworm-slim
3-
LABEL "name"="rtl-ais" \
4-
"description"="AIS ship decoding using an RTL-SDR dongle" \
5-
"author"="Bryan Klofas KF6ZEO"
6+
WORKDIR /usr/src/app
7+
8+
COPY . /usr/src/app
9+
10+
# Upgrade bookworm and install dependencies
11+
RUN apt-get -y update && apt -y upgrade && apt-get -y install --no-install-recommends \
12+
rtl-sdr \
13+
librtlsdr-dev \
14+
libusb-1.0-0-dev \
15+
build-essential \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
# Build rtl_ais
19+
RUN make && \
20+
make install
621

7-
ENV APP=/usr/src/app
822

9-
WORKDIR $APP
23+
# -------------------------
24+
# The application container
25+
# -------------------------
26+
FROM debian:bookworm-slim
1027

11-
COPY . $APP
28+
LABEL org.opencontainers.image.title="rtl-ais"
29+
LABEL org.opencontainers.image.description="AIS decoding using RTL-SDR dongle"
30+
LABEL org.opencontainers.image.authors="Bryan Klofas KF6ZEO bklofas@gmail"
31+
LABEL org.opencontainers.image.source="https://github.com/bklofas/rtl-ais"
1232

33+
# Upgrade bookworm and install dependencies
1334
RUN apt-get -y update && apt -y upgrade && apt-get -y install --no-install-recommends \
14-
rtl-sdr \
15-
librtlsdr-dev \
16-
libusb-1.0-0-dev \
17-
make \
18-
build-essential \
19-
pkg-config \
20-
&& rm -rf /var/lib/apt/lists/*
21-
22-
RUN make && \
23-
make install
35+
tini \
36+
rtl-sdr \
37+
librtlsdr-dev \
38+
libusb-1.0-0-dev &&\
39+
rm -rf /var/lib/apt/lists/*
40+
41+
COPY --from=build /usr/src/app /app
42+
43+
# Use tini as init.
44+
ENTRYPOINT ["/usr/bin/tini", "--"]
2445

25-
CMD ["/usr/src/app/rtl_ais", "-n"]
46+
CMD ["/app/rtl_ais", "-n"]
2647

0 commit comments

Comments
 (0)