troglobit / pimd

PIM-SM/SSM multicast routing for UNIX and Linux
http://troglobit.com/projects/pimd/
BSD 3-Clause "New" or "Revised" License
194 stars 86 forks source link

Publish docker image #147

Closed gclawes closed 5 years ago

gclawes commented 5 years ago

I've created a PR (#146) with a Dockerfile that builds pimd/pimctl and packages them in a debian:stretch image. Can this be published to https://hub.docker.com/u/troglobit

gclawes commented 5 years ago

This Dockerfile let me build the latest tag (2.3.2), as well:

FROM debian:stretch

COPY . /root/pimd
WORKDIR /root/pimd
RUN apt-get update && apt-get install -y build-essential automake git
RUN ./configure --prefix=/usr --sysconfdir=/etc
RUN make

FROM debian:stretch
COPY --from=0 /root/pimd/pimd /usr/sbin/
COPY --from=0 /root/pimd/pimd.conf /etc

CMD [ "/usr/sbin/pimd", "--foreground" ]
troglobit commented 5 years ago

Cool, thanks man!

Any particular reason you chose debian and not alpine?

gclawes commented 5 years ago

Switched to alpine. Here's an updated Dockerfile to manually build version 2.3.2:

FROM alpine:3.9

COPY . /root/pimd
WORKDIR /root/pimd
RUN apk add --update build-base automake autoconf linux-headers git
RUN ./configure --prefix=/usr --sysconfdir=/etc
RUN make

FROM alpine:3.9
COPY --from=0 /root/pimd/pimd /usr/sbin/
COPY --from=0 /root/pimd/pimd.conf /etc

CMD [ "/usr/sbin/pimd", "--foreground" ]
troglobit commented 5 years ago

Neat, thank you! I guess you want both the 2.3.2 and latest master on dockerhub, right?

gclawes commented 5 years ago

Yeah, both would be good. It's up to you if you want :latest to mean latest commit or latest tag (I've seen both in the docker world), but I don't see a tag anywhere for the 3.0-beta1 version.

gclawes commented 5 years ago

I've seen some places use :latest for latest-tag, and either :master or :snapshot for latest-commit.

troglobit commented 5 years ago

Ah, overloaded term of course ... snapshot is perhaps the best then.

(We currently don't tag intermediate versions like beta or RC in this project.)

troglobit commented 5 years ago

Pushed. Hopefully it works to your liking. I had to modify the (above) Dockerfile for v2.3.2 quite heavily since we didn't have autoconf-based configure script back then, and we also used GIT submodules for some BSD replacement functions.

gclawes commented 5 years ago

Thanks! Since :2.3.2 is the latest tag, can you push that to :latest as well so docker pull troglobit/pimd works properly?

$ docker pull troglobit/pimd
Using default tag: latest
Error response from daemon: manifest for troglobit/pimd:latest not found
troglobit commented 5 years ago

Sure, fixed.