Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
spire/Dockerfile at main · spiffe/spire · GitHub
Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
spiffe
spire
Repository navigation
Code
Issues
92
(92)
Pull requests
30
(30)
Actions
Projects
Wiki
Security and quality
3
(3)
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
spire
/
Dockerfile
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
85 lines (74 loc) · 3.53 KB
main
Breadcrumbs
spire
/
Dockerfile
Copy path
Top
File metadata and controls
Code
Blame
85 lines (74 loc) · 3.53 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#
syntax = docker/dockerfile:1.6.0@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021
#
Build stage
ARG
goversion
FROM
--platform=${BUILDPLATFORM} golang:${goversion}-alpine3.23 as base
WORKDIR
/spire
RUN
apk --no-cache --update add file bash clang lld pkgconfig git make
COPY
go.* ./
#
https://go.dev/ref/mod#module-cache
RUN
--mount=type=cache,target=/go/pkg/mod go mod download
COPY
. .
#
xx is a helper for cross-compilation
#
when bumping to a new version analyze the new version for security issues
#
then use crane to lookup the digest of that version so we are immutable
#
crane digest tonistiigi/xx:1.3.0
FROM
--platform=$BUILDPLATFORM tonistiigi/xx:1.7.0@sha256:010d4b66aed389848b0694f91c7aaee9df59a6f20be7f5d12e53663a37bd14e2 AS xx
FROM
--platform=${BUILDPLATFORM} base as builder
ARG
TAG
ARG
TARGETPLATFORM
ARG
TARGETARCH
COPY
--link --from=xx / /
RUN
xx-go --wrap
RUN
set -e ; xx-apk --no-cache --update add build-base musl-dev libseccomp-dev
ENV
CGO_ENABLED=1
RUN
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
if [
"$TARGETARCH"
=
"arm64"
]; then CC=aarch64-alpine-linux-musl; elif [
"$TARGETARCH"
=
"s390x"
]; then CC=s390x-alpine-linux-musl; fi && \
make build-static git_tag=$TAG git_dirty=
""
&& \
for f in $(find bin -executable -type f); do xx-verify --static $f; done
FROM
--platform=${BUILDPLATFORM} scratch AS spire-base
COPY
--link --from=builder --chown=root:root --chmod=755 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
WORKDIR
/opt/spire
#
Preparation environment for setting up directories
FROM
alpine as prep-spire-server
RUN
mkdir -p /spireroot/opt/spire/bin \
/spireroot/etc/spire/server \
/spireroot/run/spire/server/private \
/spireroot/tmp/spire-server/private \
/spireroot/var/lib/spire/server
FROM
alpine as prep-spire-agent
RUN
mkdir -p /spireroot/opt/spire/bin \
/spireroot/etc/spire/agent \
/spireroot/run/spire/agent/public \
/spireroot/tmp/spire-agent/public \
/spireroot/var/lib/spire/agent
#
For users that wish to run SPIRE containers with a specific uid and gid, the
#
spireuid and spiregid arguments are provided. The default paths that SPIRE
#
will try to read from, write to, and create at runtime are given the
#
corresponding file ownership/permissions at build time.
#
A default non-root user is defined for SPIRE Server and the OIDC Discovery
#
Provider. The SPIRE Agent image runs as root by default to facilitate the
#
sharing of the agent socket in Kubernetes environments.
#
SPIRE Server
FROM
spire-base AS spire-server
ARG
spireuid=1000
ARG
spiregid=1000
USER
${spireuid}:${spiregid}
ENTRYPOINT
[
"/opt/spire/bin/spire-server"
,
"run"
]
COPY
--link --from=prep-spire-server --chown=${spireuid}:${spiregid} --chmod=755 /spireroot /
COPY
--link --from=builder --chown=${spireuid}:${spiregid} --chmod=755 /spire/bin/static/spire-server /opt/spire/bin/
#
SPIRE Agent
FROM
spire-base AS spire-agent
ARG
spireuid=0
ARG
spiregid=0
USER
${spireuid}:${spiregid}
ENTRYPOINT
[
"/opt/spire/bin/spire-agent"
,
"run"
]
COPY
--link --from=prep-spire-agent --chown=${spireuid}:${spiregid} --chmod=755 /spireroot /
COPY
--link --from=builder --chown=${spireuid}:${spiregid} --chmod=755 /spire/bin/static/spire-agent /opt/spire/bin/
#
OIDC Discovery Provider
FROM
spire-base AS oidc-discovery-provider
ARG
spireuid=1000
ARG
spiregid=1000
USER
${spireuid}:${spiregid}
ENTRYPOINT
[
"/opt/spire/bin/oidc-discovery-provider"
]
COPY
--link --from=builder --chown=${spireuid}:${spiregid} --chmod=755 /spire/bin/static/oidc-discovery-provider /opt/spire/bin/
You can’t perform that action at this time.