mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
cmd/tsidp: add README and Dockerfile (#15205)
This commit is contained in:
41
cmd/tsidp/Dockerfile
Normal file
41
cmd/tsidp/Dockerfile
Normal file
@@ -0,0 +1,41 @@
|
||||
# Build stage
|
||||
FROM golang:alpine AS builder
|
||||
|
||||
# Install build dependencies
|
||||
RUN apk add --no-cache git
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /src
|
||||
|
||||
# Copy only go.mod and go.sum first to leverage Docker caching
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy the entire repository
|
||||
COPY . .
|
||||
|
||||
# Build the tsidp binary
|
||||
RUN go build -o /bin/tsidp ./cmd/tsidp
|
||||
|
||||
# Final stage
|
||||
FROM alpine:latest
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p /var/lib/tsidp
|
||||
|
||||
# Copy binary from builder stage
|
||||
COPY --from=builder /bin/tsidp /app/tsidp
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Environment variables
|
||||
ENV TAILSCALE_USE_WIP_CODE=1 \
|
||||
TS_HOSTNAME=tsidp \
|
||||
TS_STATE_DIR=/var/lib/tsidp
|
||||
|
||||
# Expose the default port
|
||||
EXPOSE 443
|
||||
|
||||
# Run the application
|
||||
ENTRYPOINT ["/app/tsidp"]
|
Reference in New Issue
Block a user