2023-04-14 21:27:40 -07:00
|
|
|
# syntax=docker/dockerfile:latest
|
|
|
|
ARG BASE_IMAGE
|
2024-01-14 14:57:09 -08:00
|
|
|
ARG LINUX_DISTRO=alpine
|
|
|
|
% if [[ "$BASE_IMAGE_COPY" ]]; then
|
|
|
|
FROM <% $LINUX_DISTRO %>
|
|
|
|
COPY --from=<% $BASE_IMAGE %> / /
|
|
|
|
% else
|
|
|
|
FROM $BASE_IMAGE
|
|
|
|
% fi
|
|
|
|
|
2023-04-14 21:27:40 -07:00
|
|
|
ARG BASE_IMAGE
|
|
|
|
ARG VERBOSE
|
2023-04-22 08:19:45 -07:00
|
|
|
ARG REBUILD
|
2023-04-14 21:27:40 -07:00
|
|
|
ARG LINUX_DISTRO=alpine
|
|
|
|
WORKDIR /build
|
|
|
|
|
2023-04-22 08:19:45 -07:00
|
|
|
# CORE
|
|
|
|
RUN --mount=type=bind,source=./core,target=/build \
|
2023-04-14 21:27:40 -07:00
|
|
|
<<eot
|
2023-04-22 08:19:45 -07:00
|
|
|
.INCLUDE core.tpl
|
2023-04-14 21:27:40 -07:00
|
|
|
eot
|
|
|
|
|
2023-04-22 08:19:45 -07:00
|
|
|
% if [[ ( "$_packages_" && ! $BUILD_SRC = "_core_" ) ]]; then
|
|
|
|
.INCLUDE packages.run
|
|
|
|
% fi
|
2023-04-14 21:27:40 -07:00
|
|
|
|
2024-01-14 14:57:09 -08:00
|
|
|
% if [[ ( -d "$BUILD_SRC/rootfs" && ! $BUILD_SRC = "_core_" ) ]]; then
|
|
|
|
COPY .src/rootfs/ /
|
|
|
|
% fi
|
|
|
|
|
|
|
|
|
|
|
|
% if [[ ( -f "$BUILD_SRC/init/init.sh" && ! $BUILD_SRC = "_core_" ) ]]; then
|
2023-04-22 08:19:45 -07:00
|
|
|
.INCLUDE init.run
|
|
|
|
% fi
|
2023-04-14 21:27:40 -07:00
|
|
|
|
2024-01-14 14:57:09 -08:00
|
|
|
# appends any additional custom Dockerfile code in source
|
|
|
|
.INCLUDE "$BDIR/.src/Dockerfile"
|
|
|
|
|
|
|
|
% if [[ $VOLUME_DIRS ]]; then
|
|
|
|
VOLUME <% $VOLUME_DIRS %>
|
|
|
|
% fi
|
|
|
|
|
2023-04-14 21:27:40 -07:00
|
|
|
# default command
|
|
|
|
ENTRYPOINT ["/opt/bin/entrypoint"]
|
|
|
|
# default
|
2024-01-14 14:57:09 -08:00
|
|
|
WORKDIR <% ${WORKDIR:-/opt} %>
|
2023-04-14 21:27:40 -07:00
|
|
|
|
|
|
|
|