-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
64 lines (50 loc) · 1.68 KB
/
Copy pathContainerfile
File metadata and controls
64 lines (50 loc) · 1.68 KB
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
# SPDX-License-Identifier: MPL-2.0
# Wolfi-based container for bitfuckit
# Build: nerdctl build -t bitfuckit:latest .
# Run: nerdctl run -it --rm bitfuckit:latest --help
# Stage 1: Build environment
FROM cgr.dev/chainguard/wolfi-base:latest AS builder
# Install Ada compiler and build dependencies
RUN apk add --no-cache \
gcc \
gnat \
gprbuild \
curl-dev \
make \
git
WORKDIR /build
COPY . .
# Build the binary
RUN gprbuild -P bitfuckit.gpr -j0 -XLIBRARY_TYPE=static
# Stage 2: Minimal runtime image
FROM cgr.dev/chainguard/wolfi-base:latest
# Runtime dependencies only
RUN apk add --no-cache \
curl \
git \
ca-certificates
# Create non-root user
RUN addgroup -S bitfuckit && adduser -S bitfuckit -G bitfuckit
# Copy binary from builder
COPY --from=builder /build/bin/bitfuckit /usr/local/bin/bitfuckit
# Copy completions and docs
COPY --from=builder /build/completions /usr/share/bitfuckit/completions
COPY --from=builder /build/doc /usr/share/bitfuckit/doc
# Set ownership
RUN chown -R bitfuckit:bitfuckit /usr/share/bitfuckit
# Runtime config
USER bitfuckit
WORKDIR /home/bitfuckit
# Config directory
VOLUME ["/home/bitfuckit/.config/bitfuckit"]
# Default command
ENTRYPOINT ["/usr/local/bin/bitfuckit"]
CMD ["--help"]
# Labels
LABEL org.opencontainers.image.title="bitfuckit"
LABEL org.opencontainers.image.description="The Bitbucket CLI Atlassian never made"
LABEL org.opencontainers.image.version="0.2.0"
LABEL org.opencontainers.image.vendor="hyperpolymath"
LABEL org.opencontainers.image.licenses="MPL-2.0"
LABEL org.opencontainers.image.source="https://github.com/hyperpolymath/bitfuckit"
LABEL org.opencontainers.image.base.name="cgr.dev/chainguard/wolfi-base"