Skip to content

Commit

Permalink
Simplify Dockerfile (#960)
Browse files Browse the repository at this point in the history
* Simplify Dockerfile

* Update test-dockerfile.yml
  • Loading branch information
shinsenter authored Aug 13, 2024
1 parent 09aee31 commit d8a138c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/test-dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ jobs:
run: docker save --output /tmp/image.tar test:latest
-
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
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
echo 'File not found'
exit 1
Expand Down
11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

LABEL org.opencontainers.image.source="https://github.com/mlocati/docker-php-extension-installer" \
org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.source="https://github.com/mlocati/docker-php-extension-installer"
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

0 comments on commit d8a138c

Please sign in to comment.