2017-03-14 04:37:37 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								FROM alpine:latest
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								EXPOSE 53 53/udp
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-26 16:07:57 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								RUN apk --update upgrade && apk add bind bind-tools bind-plugins
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 04:37:37 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-12 23:35:24 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# /etc/bind needs to be owned by root, group owned by "bind", and chmod 750
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# since we are mounting, do it manually
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# NOTE: Per Dockerfile manual --> need to mkdir the mounted dir to chown
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# &
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# /var/bind needs to be owned by root, group owned by "bind", and chmod 770
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 04:37:37 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# since we are mounting, do it manually
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# NOTE: Per Dockerfile manual --> need to mkdir the mounted dir to chown
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-12 23:35:24 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# &
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Get latest bind.keys
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								RUN mkdir -m 0770 -p /etc/bind && chown -R root:named /etc/bind ; \
							 | 
						
					
						
							
								
									
										
										
										
											2019-05-04 02:25:54 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    mkdir -m 0770 -p /var/cache/bind && chown -R named:named /var/cache/bind ; \
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-12 23:35:24 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    wget -q -O /etc/bind/bind.keys https://ftp.isc.org/isc/bind9/keys/9.11/bind.keys.v9_11 ; \
							 | 
						
					
						
							
								
									
										
										
										
											2019-06-26 01:34:19 -04:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    rndc-confgen -a
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-12 23:35:24 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								COPY configs/. /etc/bind/
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 04:37:37 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Mounts
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# NOTE: Per Dockerfile manual -->
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#	"if any build steps change the data within the volume
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# 	 after it has been declared, those changes will be discarded."
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								VOLUME ["/etc/bind"]
							 | 
						
					
						
							
								
									
										
										
										
											2018-02-28 10:50:35 -05:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								VOLUME ["/var/cache/bind"]
							 | 
						
					
						
							
								
									
										
										
										
											2017-03-14 04:37:37 -04:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								COPY entrypoint.sh /
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ENTRYPOINT ["/entrypoint.sh"]
							 |