-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (44 loc) 路 2.16 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (44 loc) 路 2.16 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
FROM php:8.5-cli@sha256:97ed246443f4b608841a2b30559a6f758114226b51e020d7327ded02e9076aa3 AS builder
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install --no-install-recommends -y libzip-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install zip
# Install composer.
# @see https://getcomposer.org/download
# renovate: datasource=github-releases depName=composer/composer extractVersion=^(?<version>.*)$
ENV COMPOSER_ALLOW_SUPERUSER=1
# hadolint ignore=DL4006
RUN version=2.8.10 && \
curl -sS https://getcomposer.org/download/${version}/composer.phar.sha256sum | awk '{ print $1, "composer.phar" }' > composer.phar.sha256sum && \
curl -sS -o composer.phar https://getcomposer.org/download/${version}/composer.phar && \
sha256sum -c composer.phar.sha256sum && \
chmod +x composer.phar && \
mv composer.phar /usr/local/bin/composer && \
rm composer.phar.sha256sum && \
composer --version && \
composer clear-cache
WORKDIR /app
COPY composer.json composer.lock /app/
RUN COMPOSER_MEMORY_LIMIT=-1 composer install -n --ansi --prefer-dist --optimize-autoloader
COPY . /app
RUN composer build
FROM php:8.5-cli@sha256:97ed246443f4b608841a2b30559a6f758114226b51e020d7327ded02e9076aa3
# git is required because the tool shells out to the git binary; openssh-client
# enables pushing to SSH remotes such as git@github.com:org/repo.git.
# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install --no-install-recommends -y git openssh-client && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# The container operates on repositories bind-mounted from the host at runtime -
# a source and a destination whose paths are chosen by the caller and unknown at
# build time - while running as root. Trust all directories so git does not
# reject these host-owned mounts for dubious ownership; the container is
# single-purpose and ephemeral, so the wildcard is an acceptable trust boundary.
RUN git config --system --add safe.directory '*'
WORKDIR /app
COPY --from=builder /app/.build/git-artifact /usr/local/bin/git-artifact
RUN chmod +x /usr/local/bin/git-artifact
ENTRYPOINT ["/usr/local/bin/git-artifact"]