Move keygen so we can autossh and not care if the pod dies
Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
		
							parent
							
								
									a8bbb48877
								
							
						
					
					
						commit
						9af04b6208
					
				
					 3 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
					@ -1,6 +1,7 @@
 | 
				
			||||||
FROM library/alpine
 | 
					FROM library/alpine
 | 
				
			||||||
RUN apk add --no-cache openssh && \
 | 
					RUN apk add --no-cache openssh && \
 | 
				
			||||||
  sed -i /etc/ssh/sshd_config -e s/'#Port.*'/'Port 2222'/ -e s/'AllowTcpForwarding.*'/'AllowTcpForwarding yes'/
 | 
					  sed -i /etc/ssh/sshd_config -e s/'#Port.*'/'Port 2222'/ -e s/'AllowTcpForwarding.*'/'AllowTcpForwarding yes'/ && \
 | 
				
			||||||
 | 
					  ssh-keygen -A
 | 
				
			||||||
RUN adduser -D -s /bin/ash beagle
 | 
					RUN adduser -D -s /bin/ash beagle
 | 
				
			||||||
ADD beagle.key /home/beagle/.ssh/authorized_keys
 | 
					ADD beagle.key /home/beagle/.ssh/authorized_keys
 | 
				
			||||||
RUN passwd -u beagle && \
 | 
					RUN passwd -u beagle && \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										3
									
								
								docker/ssh/buildandpush.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										3
									
								
								docker/ssh/buildandpush.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					docker build . -t imartyn/ssh
 | 
				
			||||||
 | 
					docker push imartyn/ssh
 | 
				
			||||||
| 
						 | 
					@ -23,7 +23,7 @@ spec:
 | 
				
			||||||
        command:
 | 
					        command:
 | 
				
			||||||
        - sh
 | 
					        - sh
 | 
				
			||||||
        - -c
 | 
					        - -c
 | 
				
			||||||
        - ssh-keygen -A; /usr/sbin/sshd -D -p 22
 | 
					        - /usr/sbin/sshd -D -p 22
 | 
				
			||||||
        ports:
 | 
					        ports:
 | 
				
			||||||
        - containerPort: 22
 | 
					        - containerPort: 22
 | 
				
			||||||
          name: ssh
 | 
					          name: ssh
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue