25 lines
		
	
	
		
			889 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			889 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
| FROM alpine:3.20.0 as builder
 | |
| 
 | |
| RUN apk update && apk add go
 | |
| RUN mkdir -p /opt/converge/bin
 | |
| COPY cmd pkg static go.mod go.sum /opt/converge/
 | |
| WORKDIR /opt/converge
 | |
| RUN go mod download
 | |
| COPY . /opt/converge/
 | |
| RUN go build -ldflags "-linkmode 'external' -extldflags '-static'" -o bin ./cmd/...
 | |
| RUN GOOS=windows GOARCH=amd64 go build -o bin ./cmd/...
 | |
| 
 | |
| FROM scratch
 | |
| 
 | |
| COPY --from=builder /opt/converge/bin/converge /opt/converge/bin/
 | |
| COPY --from=builder /opt/converge/bin/agent \
 | |
|                     /opt/converge/bin/tcptows \
 | |
|                     /opt/converge/bin/wsproxy \
 | |
|                     /opt/converge/bin/agent.exe \
 | |
|                     /opt/converge/bin/tcptows.exe \
 | |
|                     /opt/converge/bin/wsproxy.exe \
 | |
|                     /opt/converge/docs/
 | |
| COPY --from=builder /opt/converge/static/ /opt/converge/docs/
 | |
| 
 | |
| ENTRYPOINT ["/opt/converge/bin/converge", "/opt/converge/docs" ]
 |