| 
									
										
										
										
											2025-06-30 14:06:45 +00:00
										 |  |  | FROM node:20.19.2-alpine3.20 | 
					
						
							|  |  |  | ENV KB_VER=8.18.3 | 
					
						
							| 
									
										
										
										
											2024-09-06 14:45:51 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2017-10-13 18:58:14 +00:00
										 |  |  | # Include dist | 
					
						
							| 
									
										
										
										
											2022-03-08 23:36:03 +00:00
										 |  |  | COPY dist/ /root/dist/ | 
					
						
							| 
									
										
										
										
											2019-08-15 15:38:12 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2024-09-11 10:42:17 +00:00
										 |  |  | # Install packages | 
					
						
							| 
									
										
										
										
											2024-12-05 20:12:18 +00:00
										 |  |  | RUN apk --no-cache -U upgrade && \ | 
					
						
							|  |  |  |     apk --no-cache -U add \ | 
					
						
							| 
									
										
										
										
											2019-03-15 22:23:30 +00:00
										 |  |  |             aria2 \ | 
					
						
							| 
									
										
										
										
											2024-09-06 14:45:51 +00:00
										 |  |  |             curl \ | 
					
						
							|  |  |  |             gcompat && \ | 
					
						
							| 
									
										
										
										
											2019-08-15 15:38:12 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2022-01-23 21:12:34 +00:00
										 |  |  | # Determine arch, get and install packages | 
					
						
							|  |  |  |     ARCH=$(arch) && \ | 
					
						
							| 
									
										
										
										
											2024-09-06 14:45:51 +00:00
										 |  |  |       if [ "$ARCH" = "x86_64" ]; then KB_ARCH="x86_64"; fi && \ | 
					
						
							|  |  |  |       if [ "$ARCH" = "aarch64" ]; then KB_ARCH="aarch64"; fi && \ | 
					
						
							| 
									
										
										
										
											2022-01-23 21:12:34 +00:00
										 |  |  |     echo "$ARCH" && \ | 
					
						
							| 
									
										
										
										
											2017-10-13 18:58:14 +00:00
										 |  |  |     cd /root/dist/ && \ | 
					
						
							| 
									
										
										
										
											2024-09-06 14:45:51 +00:00
										 |  |  |     aria2c -s 16 -x 16 https://artifacts.elastic.co/downloads/kibana/kibana-$KB_VER-linux-$KB_ARCH.tar.gz && \ | 
					
						
							|  |  |  |     mkdir -p /usr/share/kibana && \ | 
					
						
							|  |  |  |     tar xvfz kibana-$KB_VER-linux-$KB_ARCH.tar.gz --strip-components=1 -C /usr/share/kibana/ && \ | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # Kibana's bundled node does not work in build pipeline | 
					
						
							| 
									
										
										
										
											2024-12-06 12:09:27 +00:00
										 |  |  |     rm /usr/share/kibana/node/glibc-217/bin/node && \ | 
					
						
							|  |  |  |     ln -s /usr/local/bin/node /usr/share/kibana/node/glibc-217/bin/node && \ | 
					
						
							| 
									
										
										
										
											2019-08-15 15:38:12 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2017-10-13 18:58:14 +00:00
										 |  |  | # Setup user, groups and configs | 
					
						
							|  |  |  |     sed -i 's/#server.basePath: ""/server.basePath: "\/kibana"/' /usr/share/kibana/config/kibana.yml && \ | 
					
						
							|  |  |  |     sed -i 's/#server.host: "localhost"/server.host: "0.0.0.0"/' /usr/share/kibana/config/kibana.yml && \ | 
					
						
							| 
									
										
										
										
											2019-02-28 14:52:42 +00:00
										 |  |  |     sed -i 's/#elasticsearch.hosts: \["http:\/\/localhost:9200"\]/elasticsearch.hosts: \["http:\/\/elasticsearch:9200"\]/' /usr/share/kibana/config/kibana.yml && \ | 
					
						
							| 
									
										
										
										
											2018-11-23 22:32:11 +00:00
										 |  |  |     sed -i 's/#server.rewriteBasePath: false/server.rewriteBasePath: false/' /usr/share/kibana/config/kibana.yml && \ | 
					
						
							| 
									
										
										
										
											2022-01-07 18:03:00 +00:00
										 |  |  |     echo "xpack.reporting.roles.enabled: false" >> /usr/share/kibana/config/kibana.yml && \ | 
					
						
							| 
									
										
										
										
											2020-02-14 15:28:06 +00:00
										 |  |  |     echo "elasticsearch.requestTimeout: 60000" >> /usr/share/kibana/config/kibana.yml && \ | 
					
						
							|  |  |  |     echo "elasticsearch.shardTimeout: 60000" >> /usr/share/kibana/config/kibana.yml && \ | 
					
						
							| 
									
										
										
										
											2024-11-26 16:05:30 +00:00
										 |  |  |     echo "unifiedSearch.autocomplete.valueSuggestions.timeout: 60000" >> /usr/share/kibana/config/kibana.yml && \ | 
					
						
							|  |  |  |     echo "unifiedSearch.autocomplete.valueSuggestions.terminateAfter: 1000000" >> /usr/share/kibana/config/kibana.yml && \ | 
					
						
							| 
									
										
										
										
											2019-02-28 14:52:42 +00:00
										 |  |  |     rm -rf /usr/share/kibana/optimize/bundles/* && \ | 
					
						
							| 
									
										
										
										
											2020-01-31 14:21:55 +00:00
										 |  |  |     /usr/share/kibana/bin/kibana --optimize --allow-root && \ | 
					
						
							| 
									
										
										
										
											2024-09-06 14:45:51 +00:00
										 |  |  |     addgroup -g 2000 kibana && \ | 
					
						
							|  |  |  |     adduser -S -H -s /bin/ash -u 2000 -D -g 2000 kibana && \ | 
					
						
							|  |  |  |     chown -R kibana:kibana /usr/share/kibana/data && \ | 
					
						
							| 
									
										
										
										
											2022-01-23 21:12:34 +00:00
										 |  |  |     chmod 755 -R /usr/share/kibana/config && \ | 
					
						
							| 
									
										
										
										
											2019-08-15 15:38:12 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2017-10-13 18:58:14 +00:00
										 |  |  | # Clean up | 
					
						
							| 
									
										
										
										
											2024-09-06 14:45:51 +00:00
										 |  |  |     apk del --purge aria2 && \ | 
					
						
							| 
									
										
										
										
											2024-09-11 10:42:17 +00:00
										 |  |  |     rm -rf /root/* \ | 
					
						
							|  |  |  |         /tmp/* \ | 
					
						
							|  |  |  |         /var/cache/apk/* | 
					
						
							| 
									
										
										
										
											2019-08-15 15:38:12 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2017-10-13 18:58:14 +00:00
										 |  |  | # Healthcheck | 
					
						
							|  |  |  | HEALTHCHECK --retries=10 CMD curl -s -XGET 'http://127.0.0.1:5601' | 
					
						
							| 
									
										
										
										
											2019-08-15 15:38:12 +00:00
										 |  |  | # | 
					
						
							| 
									
										
										
										
											2017-10-23 11:02:04 +00:00
										 |  |  | # Start kibana | 
					
						
							| 
									
										
										
										
											2018-09-11 12:19:26 +00:00
										 |  |  | STOPSIGNAL SIGKILL | 
					
						
							| 
									
										
										
										
											2018-03-31 15:18:28 +00:00
										 |  |  | USER kibana:kibana | 
					
						
							| 
									
										
										
										
											2017-10-13 18:58:14 +00:00
										 |  |  | CMD ["/usr/share/kibana/bin/kibana"] |