mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	Add Docker multiarch support
This commit is contained in:
		
							parent
							
								
									89a3718d59
								
							
						
					
					
						commit
						48f9de3b5c
					
				
					 3 changed files with 94 additions and 0 deletions
				
			
		
							
								
								
									
										29
									
								
								contrib/docker/Dockerfile.multiarch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								contrib/docker/Dockerfile.multiarch
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
# syntax=docker/dockerfile:1
 | 
			
		||||
FROM --platform=$BUILDPLATFORM docker.io/golang:alpine as builder
 | 
			
		||||
 | 
			
		||||
COPY . /src
 | 
			
		||||
WORKDIR /src
 | 
			
		||||
 | 
			
		||||
ARG TARGETOS
 | 
			
		||||
ARG TARGETARCH
 | 
			
		||||
ENV CGO_ENABLED=0
 | 
			
		||||
ENV GOOS=${TARGETOS} GOARCH=${TARGETARCH}
 | 
			
		||||
 | 
			
		||||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} apk add git && ./build && go build -o /src/genkeys cmd/genkeys/main.go
 | 
			
		||||
 | 
			
		||||
FROM docker.io/alpine
 | 
			
		||||
 | 
			
		||||
COPY --from=builder /src/yggdrasil /usr/bin/yggdrasil
 | 
			
		||||
COPY --from=builder /src/yggdrasilctl /usr/bin/yggdrasilctl
 | 
			
		||||
COPY --from=builder /src/genkeys /usr/bin/genkeys
 | 
			
		||||
COPY contrib/docker/entrypoint.sh /usr/bin/entrypoint.sh
 | 
			
		||||
 | 
			
		||||
# RUN addgroup -g 1000 -S yggdrasil-network \
 | 
			
		||||
#  && adduser -u 1000 -S -g 1000 --home /etc/yggdrasil-network yggdrasil-network
 | 
			
		||||
#
 | 
			
		||||
# USER yggdrasil-network
 | 
			
		||||
# TODO: Make running unprivileged work
 | 
			
		||||
 | 
			
		||||
VOLUME [ "/etc/yggdrasil-network" ]
 | 
			
		||||
 | 
			
		||||
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue