forked from mtrojnar/osslsigncode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Stage 1: Build osslsigncode on Alpine | ||
FROM alpine:latest AS builder | ||
|
||
# Install build dependencies | ||
RUN apk add --no-cache build-base cmake openssl-dev curl-dev | ||
|
||
# Copy osslsigncode source code into the image | ||
COPY . /source | ||
|
||
# Build osslsigncode | ||
RUN cd /source && \ | ||
mkdir -p build && \ | ||
cd build && \ | ||
rm -f CMakeCache.txt && \ | ||
cmake -S .. && \ | ||
cmake --build . && \ | ||
cmake --install . | ||
|
||
# Stage 2: Create final image without build environment | ||
FROM alpine:latest | ||
|
||
# Copy compiled binary from builder stage | ||
COPY --from=builder /usr/local/bin/osslsigncode /usr/local/bin/osslsigncode | ||
|
||
# Install necessary runtime libraries (latest version) | ||
RUN apk add --no-cache libcrypto3 libcurl | ||
|
||
# Set working directory | ||
WORKDIR /workdir | ||
|
||
# Declare volume to mount files | ||
VOLUME [ "/workdir" ] |