forked from psalm/psalm-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
55 lines (38 loc) · 1.84 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
FROM php:7.4-alpine
LABEL "com.github.actions.name"="Psalm"
LABEL "com.github.actions.description"="A static analysis tool for finding errors in PHP applications"
LABEL "com.github.actions.icon"="check"
LABEL "com.github.actions.color"="blue"
LABEL "repository"="http://github.com/psalm/psalm-github-actions"
LABEL "homepage"="http://github.com/actions"
LABEL "maintainer"="Matt Brown <[email protected]>"
# Code borrowed from mickaelandrieu/psalm-ga which in turn borrowed from phpqa/psalm
# Install Tini - https://github.com/krallin/tini
RUN apk add --no-cache tini git openssh-client
# Install PHP extensions
RUN buildDeps="libxml2-dev libmcrypt-dev libpng-dev imap-dev krb5-dev openssl-dev icu-dev gmp-dev libzip-dev zip runit ${PHPIZE_DEPS}" \
&& apk add --no-cache $buildDeps \
&& docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install bcmath intl pdo_mysql imap soap opcache zip gmp gd calendar \
&& pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis \
&& apk del $PHPIZE_DEPS
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
RUN COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME="/composer" \
composer global config minimum-stability dev
# This line invalidates cache when master branch change
ADD https://github.com/vimeo/psalm/commits/master.atom /dev/null
RUN COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME="/composer" \
composer global require vimeo/psalm --prefer-dist --no-progress --dev
ENV PATH /composer/vendor/bin:${PATH}
# Satisfy Psalm's quest for a composer autoloader (with a symlink that disappears once a volume is mounted at /app)
RUN mkdir /app && ln -s /composer/vendor/ /app/vendor
# Add entrypoint script
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Package container
WORKDIR "/app"
ENTRYPOINT ["/entrypoint.sh"]