-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* proposed dockerfile * cleaned up args and added readme section
- Loading branch information
1 parent
821d19d
commit d5b6442
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Dockerfile | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Build | ||
FROM rust:alpine as builder | ||
ARG TARGET_ARCH=x86_64-unknown-linux-musl | ||
|
||
RUN apk add --no-cache musl-dev alpine-sdk | ||
WORKDIR /usr/src/mavlink2rest | ||
COPY . . | ||
|
||
RUN rustup target add ${TARGET_ARCH} | ||
|
||
RUN cargo build --release --target=${TARGET_ARCH} | ||
|
||
|
||
# Runtime environment | ||
FROM alpine | ||
WORKDIR /root/ | ||
|
||
ARG TARGET_ARCH=x86_64-unknown-linux-musl | ||
|
||
COPY --from=builder /usr/src/mavlink2rest/target/${TARGET_ARCH}/release/mavlink2rest ./mavlink2rest | ||
|
||
ENV MAVLINK_SRC="udpin:0.0.0.0:14550" | ||
ENV SERVER_PORT="0.0.0.0:8088" | ||
ENV EXTRA_ARGS="" | ||
|
||
RUN chmod +x mavlink2rest | ||
|
||
ENTRYPOINT ./mavlink2rest -c ${MAVLINK_SRC} -s ${SERVER_PORT} ${EXTRA_ARGS} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters