mirror of
				https://github.com/honestbee/drone-kubernetes.git
				synced 2025-11-04 02:58:04 +00:00 
			
		
		
		
	Update Dockerfile to Best Practices:
- Version pinning on Base Image - COPY is preferred over ADD - apk -U will leave index in image, use `--no-cache` to avoid storing repo index - curl kubectl directly to final destination - Change entrypoint instead of running `sh -c bash -c /bin/update.sh`
This commit is contained in:
		
							parent
							
								
									4ea0a93799
								
							
						
					
					
						commit
						dae5ad67d9
					
				
					 1 changed files with 7 additions and 8 deletions
				
			
		
							
								
								
									
										15
									
								
								Dockerfile
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								Dockerfile
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,8 +1,7 @@
 | 
			
		|||
FROM alpine
 | 
			
		||||
RUN apk -Uuv add curl ca-certificates bash
 | 
			
		||||
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
 | 
			
		||||
RUN chmod +x ./kubectl
 | 
			
		||||
RUN mv ./kubectl /usr/local/bin/kubectl
 | 
			
		||||
ADD update.sh /bin/
 | 
			
		||||
RUN chmod +x /bin/update.sh
 | 
			
		||||
CMD bash -c /bin/update.sh
 | 
			
		||||
FROM alpine:3.4
 | 
			
		||||
RUN apk --no-cache add curl ca-certificates bash
 | 
			
		||||
RUN curl -o /usr/local/bin/kubectl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
 | 
			
		||||
RUN chmod +x /usr/local/bin/kubectl
 | 
			
		||||
COPY update.sh /bin/
 | 
			
		||||
ENTRYPOINT ["/bin/bash"]
 | 
			
		||||
CMD ["/bin/update.sh"]
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue