项目作者: yottadynamics

项目描述 :
Container Running Bind/Named Service
高级语言: Makefile
项目地址: git://github.com/yottadynamics/bind.git
创建时间: 2020-04-09T13:51:09Z
项目社区:https://github.com/yottadynamics/bind

开源协议:MIT License

下载


bind

Note: I’m using podman and it should be working with docker as well.

Make usage

  1. $ make help
  2. build Build container from Dockerfile
  3. run Run $(PROJECT_NAME) container
  4. restart Restart container
  5. test Run nslookup on foobar.yotta.local
  6. clean Remove previous build
  7. help Display this help screen

Build the image

  1. $ make build
  2. STEP 1: FROM centos:8
  3. STEP 2: RUN yum -y install bind-utils bind && yum clean all
  4. --> Using cache a3fd30d59d9b4935e1ef18a6a998b79eae2dc448051684d04fe15462aa8a3c04
  5. STEP 3: ADD ./entrypoint.sh /
  6. --> Using cache 0a4faeafde797774b80e79b99771e9c4cddd2e6906ed5c481371f2b4731b9ca7
  7. STEP 4: VOLUME /opt/named
  8. --> Using cache 5fa7d1787a74795892b8dacbc8ddb4e2b58edfe11d1852ccc629e4af4ff2a6eb
  9. STEP 5: EXPOSE 53 53/udp
  10. --> Using cache 3d92cce07b31a7c2950f78ddd04fc836610c77cde75fc462f80613db3a9a8913
  11. STEP 6: RUN named-checkconf /etc/named.conf
  12. --> Using cache c586ef054118c855c2bfd9b3fc60b305e627015dacaabd3ad8f52008da979499
  13. STEP 7: ENTRYPOINT [ "/entrypoint.sh" ]
  14. --> Using cache 91cf97dc3bbaf4bf910e5f6e8a3058f8b50df64f32c86a796a6e3fdde4d23450
  15. STEP 8: COMMIT yottad-bind
  16. 91cf97dc3bbaf4bf910e5f6e8a3058f8b50df64f32c86a796a6e3fdde4d23450

Run the container

  1. $ make run
  2. 42ca264ebb665af3392cd550985e5bb21311892cdcea43140f224f00c3ff6c01

Test using nslookup on test record

  1. make test
  2. Server: yotta-lab.yotta.local
  3. Address: 192.168.100.150#53
  4. Name: foo.yotta.local
  5. Address: 10.1.1.10

Check your running container

  1. $ podman ps
  2. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  3. 42ca264ebb66 localhost/bind:latest About a minute ago Up About a minute ago 0.0.0.0:53->53/tcp, 0.0.0.0:53->53/udp yottad-bind

Add DNS testrecord (foobar.yotta.local) to conf/yotta.local.db

Restart your contaienr and test

  1. $ make restart
  2. 42ca264ebb665af3392cd550985e5bb21311892cdcea43140f224f00c3ff6c01
  3. $ nslookup foobar.yotta.local $(uname -n)
  4. Server: yotta-lab.yotta.local
  5. Address: 192.168.100.150#53
  6. Name: foobar.yotta.local
  7. Address: 10.1.1.15