-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.goreleaser
More file actions
26 lines (20 loc) · 942 Bytes
/
Dockerfile.goreleaser
File metadata and controls
26 lines (20 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Dockerfile for GoReleaser - uses pre-built binary
FROM mcr.microsoft.com/azure-cli:2.82.0
LABEL org.opencontainers.image.title="azswitch"
LABEL org.opencontainers.image.description="TUI for switching Azure tenants and subscriptions"
LABEL org.opencontainers.image.source="https://github.com/l2D/azswitch"
LABEL org.opencontainers.image.licenses="MIT"
# Create non-root user
RUN tdnf install -y shadow-utils && \
groupadd -g 1000 azswitch && \
useradd -u 1000 -g azswitch -d /home/azswitch -s /bin/sh -m azswitch && \
tdnf clean all
# Copy pre-built binary from GoReleaser (dockers_v2 places binaries in $TARGETPLATFORM/)
ARG TARGETPLATFORM
COPY ${TARGETPLATFORM}/azswitch /usr/local/bin/azswitch
# Set up Azure CLI cache directory with proper ownership
RUN mkdir -p /home/azswitch/.azure && \
chown -R azswitch:azswitch /home/azswitch/.azure
USER azswitch
WORKDIR /home/azswitch
ENTRYPOINT ["/usr/local/bin/azswitch"]