sonic-buildimage/docker-lldp/Dockerfile

34 lines
1.2 KiB
Docker
Raw Normal View History

FROM docker-base
2016-03-08 13:42:20 -06:00
## Pre-install the fundamental packages
RUN apt-get update && apt-get -y install \
2016-03-08 13:42:20 -06:00
lldpd
COPY deps /deps
## Install Python SSWSDK (lldpsyncd dependancy)
## Note: dpkg_apt function has the benefit to detect missing .deb file
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/python-sswsdk_*.deb
## Install LLDP Sync Daemon
## Note: dpkg_apt function has the benefit to detect missing .deb file
RUN dpkg_apt() { [ -f $1 ] && { dpkg -i $1 || apt-get -y install -f; } || return 1; }; dpkg_apt /deps/lldpsyncd_*.deb
## Clean up
RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /deps
## There is a known bug: agetty processes at 100% cpu
## When:
## 1. running container in --privileged mode
## 2. container runs /sbin/init
## ref: https://github.com/docker/docker/issues/4040
## Temporary solution:
## Disable tty services permanently
RUN systemctl --no-pager list-unit-files --type=service | grep getty | awk '{print $1}' | xargs systemctl mask
## Note: getty@.service in last grep output will not mask below cases
RUN systemctl mask getty@tty1.service
2016-03-08 13:42:20 -06:00
## Specify init as CMD to enable systemd
## Note: don't provide ENTRYPOINT at the same time
CMD ["/sbin/init"]