Simplify Dockerfile (#960)

* Simplify Dockerfile

* Update test-dockerfile.yml
pull/962/head 2.3.6
Shin 2024-08-14 07:27:48 +09:00 committed by GitHub
parent 09aee3182e
commit d8a138cd64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 10 deletions

View File

@ -22,11 +22,16 @@ jobs:
run: docker save --output /tmp/image.tar test:latest run: docker save --output /tmp/image.tar test:latest
- -
name: Extract layer name: Extract layer
run: tar -C /tmp -x -f /tmp/image.tar --wildcards '*layer.tar' --strip-components=1 run: |
tar -C /tmp -x -f /tmp/image.tar --strip-components=1
if [ ! -d /tmp/sha256 ]; then
echo 'Cannot extract docker archive.'
exit 1
fi
- -
name: Check layer contents name: Check layer contents
run: | run: |
ENTRY="$(tar -v -t -f /tmp/layer.tar --wildcards '*bin/install-php-extensions')" ENTRY="$(find /tmp/sha256 -type f -exec tar -vtf {} \; 2>/dev/null | grep install-php-extensions)"
if [ -z "$ENTRY" ]; then if [ -z "$ENTRY" ]; then
echo 'File not found' echo 'File not found'
exit 1 exit 1

View File

@ -1,11 +1,6 @@
FROM bash AS build
COPY install-php-extensions /tmp/install-php-extensions
RUN chmod +x /tmp/install-php-extensions
FROM scratch FROM scratch
LABEL org.opencontainers.image.source="https://github.com/mlocati/docker-php-extension-installer" \ LABEL org.opencontainers.image.source="https://github.com/mlocati/docker-php-extension-installer"
org.opencontainers.image.licenses="MIT" LABEL org.opencontainers.image.licenses="MIT"
COPY --from=build /tmp/install-php-extensions /usr/bin/install-php-extensions COPY --chmod=755 install-php-extensions /usr/bin/install-php-extensions