-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (30 loc) · 1.23 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Build image with tag
# MAKE SURE VERSION IN main.cpp MATCHES
# docker build -t kilemon/socket-forwarder:0.1.0 .
# docker tag kilemon/socket-forwarder:0.1.0 kilemon/socket-forwarder:latest
#
# Push image to remote
# docker push kilemon/socket-forwarder:0.1.0
# FROM alpine:3.20.2 AS builder
FROM ubuntu:24.10 AS builder
WORKDIR /builder
# For alpine linux
# RUN apk update && apk upgrade && apk add g++ cmake make git bluez-dev glib-dev bluez gdb
RUN apt update && apt install g++ cmake make git libbluetooth-dev libglib2.0-dev bluez gdb uuid-dev liblog4cxx-dev -y
COPY ./socket-forwarder ./socket-forwarder
COPY ./tests ./tests
COPY ./CMakeLists.txt ./CMakeLists.txt
RUN ["cmake", "-B", "build", "."]
WORKDIR /builder/build
RUN ["make", "all"]
# Run the test executable directly so output logs are sent to stdout
WORKDIR /builder/build/tests
RUN ["./SocketForwarderTests"]
# FROM alpine:3.20.2 AS runner
FROM ubuntu:24.10 AS runner
WORKDIR /socket-forwarder
# For alpine linux
# RUN apk update && apk upgrade && apk add libstdc++
RUN apt update && apt install liblog4cxx-dev -y
COPY --from=builder /builder/build/SocketForwarder /socket-forwarder/SocketForwarder
ENTRYPOINT ["./SocketForwarder"]