Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Debian Buster Dockerfile #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Neolink Docker image build scripts
# Copyright (c) 2020 George Hilliard
# SPDX-License-Identifier: AGPL-3.0-only

FROM docker.io/rust:buster AS build
MAINTAINER thirtythreeforty@gmail.com

ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
build-essential \
musl-dev gcc \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably don't need musl-dev on a buster.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without it, it didn't work.

libgstrtspserver-1.0-dev \
libgstreamer1.0-dev \
libgtk2.0-dev \
libglib2.0-dev; \
apt-get clean -y; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*

# Use static linking to work around https://github.com/rust-lang/rust/pull/58575
ENV RUSTFLAGS='-C target-feature=-crt-static'
Comment on lines +21 to +22
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this workaround only required on musl?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe because of this it didn't work without musl-dev. No idea.


WORKDIR /usr/local/src/neolink

# Build the main program
COPY . /usr/local/src/neolink
RUN cargo build --release

# Create the release container. Match the base OS used to build
FROM debian:buster-slim

ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
musl-dev \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dev packages not need on publish image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without musl-dev I could not get it working. If you manage to get it out, it will be just great.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm odd. I should have my buster image on one of my branches. I'll dig it up in the morning and see what else is different.

libgstrtspserver-1.0-0 \
libgstreamer1.0-0 \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad; \
apt-get clean -y; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/*

COPY --from=build \
/usr/local/src/neolink/target/release/neolink \
/usr/local/bin/neolink

ENTRYPOINT [ "/usr/local/bin/neolink" ]
CMD [ "--config", "/etc/neolink.toml" ]

EXPOSE 8554