-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (24 loc) · 928 Bytes
/
Dockerfile
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
ARG COMPOSER_VERSION="2.8.4"
FROM ghcr.io/context-hub/docker-ctx-binary/bin-builder:latest AS builder
# Define build arguments for target platform
ARG TARGET_OS="linux"
ARG TARGET_ARCH="x86_64"
ARG VERSION="latest"
WORKDIR /app
# Copy source code
COPY . .
RUN composer install --no-dev --prefer-dist --ignore-platform-reqs
# Create build directories
RUN mkdir -p .build/phar .build/bin
# Build PHAR file
RUN /usr/local/bin/box compile -v
RUN mkdir -p ./buildroot/bin
RUN cp /build-tools/build/bin/micro.sfx ./buildroot/bin
# Combine micro.sfx with the PHAR to create the final binary
RUN /build-tools/static-php-cli/bin/spc micro:combine .build/phar/dload.phar --output=.build/bin/dload
RUN chmod +x .build/bin/dload
# Copy to output with appropriate naming including version
RUN mkdir -p /.output
RUN cp .build/bin/dload /.output/dload
# Set default entrypoint (without version in name)
ENTRYPOINT ["/.output/dload"]