Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright 2016 The Kubernetes Authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. FROM BASEIMAGE
  15. # Install latest iptables package from buster-backports
  16. RUN echo deb http://deb.debian.org/debian buster-backports main >> /etc/apt/sources.list; \
  17. apt-get update; \
  18. apt-get -t buster-backports -y --no-install-recommends install iptables
  19. # Install other dependencies and then clean up apt caches
  20. RUN clean-install \
  21. conntrack \
  22. ebtables \
  23. ipset \
  24. kmod \
  25. netbase
  26. # Install iptables wrapper scripts to detect the correct iptables mode
  27. # the first time any of them is run
  28. COPY iptables-wrapper /usr/sbin/iptables-wrapper
  29. RUN update-alternatives \
  30. --install /usr/sbin/iptables iptables /usr/sbin/iptables-wrapper 100 \
  31. --slave /usr/sbin/iptables-restore iptables-restore /usr/sbin/iptables-wrapper \
  32. --slave /usr/sbin/iptables-save iptables-save /usr/sbin/iptables-wrapper
  33. RUN update-alternatives \
  34. --install /usr/sbin/ip6tables ip6tables /usr/sbin/iptables-wrapper 100 \
  35. --slave /usr/sbin/ip6tables-restore ip6tables-restore /usr/sbin/iptables-wrapper \
  36. --slave /usr/sbin/ip6tables-save ip6tables-save /usr/sbin/iptables-wrapper