Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Zip plugin #206

Open
Boy19991 opened this issue Dec 17, 2022 · 3 comments
Open

PHP Zip plugin #206

Boy19991 opened this issue Dec 17, 2022 · 3 comments

Comments

@Boy19991
Copy link

In the php dockerfile, it seems it doesnt install any zip package.
If you try to install laravel inside the container after docker-compose up, it says something like "not zip package aborting" - at this point I found

RUN apt-get update \
     && apt-get install -y libzip-dev \
     && docker-php-ext-install zip

however, this still causes the following warning

As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.

In search of the ultimate dockerfile.
Also, sorry if this is the wrong place to ask this.
Jolly Boy.

@codespearhead
Copy link

codespearhead commented Dec 21, 2022

In the php dockerfile, it seems it doesnt install any zip package. If you try to install laravel inside the container after docker-compose up, it says something like "not zip package aborting" - at this point I found

RUN apt-get update \
     && apt-get install -y libzip-dev \
     && docker-php-ext-install zip

however, this still causes the following warning

As there is no 'unzip' nor '7z' command installed zip files are being unpacked using the PHP zip extension.
This may cause invalid reports of corrupted archives. Besides, any UNIX permissions (e.g. executable) defined in the archives will be lost.

In search of the ultimate dockerfile. Also, sorry if this is the wrong place to ask this. Jolly Boy.

I might be misinterpreting your question, but there's no point in using containerized applications, or even this project at all, if you're going to install Laravel onto the container yourself.

As a matter of fact, the container image used in the Docker files of the project don't even have APT in it since the base image is based on Alpine Linux. The Usage section of the readme file of this repository says how you should go about that instead.

As for your question per se, I just checked the container image in question, php:8-fpm-alpine, and I can confirm that it doesn't seem to come with unzip, or at least not with a full-fledged version of it.

> docker run -it --rm --name test php:8-fpm-alpine sh
> unzip -v
# BusyBox v1.35.0 (2022-11-19 10:13:10 UTC) multi-call binary. [...]
> apk add unzip
> unzip -v
# UnZip 6.00 of 20 April 2009, by Info-ZIP [...]

So try adding RUN apk add unzip on the second line of php.dockerfile (or in the other dockerfiles) and tell us if that solves the problem.

More about that Docker one-liner.

@Boy19991
Copy link
Author

@Paguiar735 Thank you for your detailed reply. I ended up solving my issue by just hacking at it until it worked.

Regarding your comment

I might be misinterpreting your question, but there's no point in using containerized applications, or even this project at all, if you're going to install Laravel onto the container yourself

Then where do you install it?
php.dockerfile installs laravel to WORKDIR /var/www/html right?
Isnt that on the container?

In my project I used composer create-project laravel on a volume

volumes:
      - ./:/var/www/html

Can you explain this point for me? If my question is retarded you can just delete this thread :)

JollyBoy.

@codespearhead
Copy link

@Paguiar735 Thank you for your detailed reply. I ended up solving my issue by just hacking at it until it worked.

Regarding your comment

I might be misinterpreting your question, but there's no point in using containerized applications, or even this project at all, if you're going to install Laravel onto the container yourself

Then where do you install it?
php.dockerfile installs laravel to WORKDIR /var/www/html right?
Isnt that on the container?

In my project I used composer create-project laravel on a volume

volumes:
      - ./:/var/www/html

Can you explain this point for me? If my question is retarded you can just delete this thread :)

JollyBoy.

I'm afraid I can't provide further assistance because I don't have any experience with the PHP ecosystem, just with containerization for the sake of the question.

If anyone here is enough well-versed with Laravel and need confirmation about the container dynamics around the project to help with this issue, feel free to ping me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants