Closed mleczakm closed 6 months ago
@mleczakm thanks for reporting! :)
I just tried to do the following:
docker/aarch64-php8.3-cli-alpine
:
FROM --platform=linux/aarch64 php:8.3-cli-alpine
COPY release/aarch64-unknown-linux-musl/phanalist /usr/bin/phanalist
docker build -f docker/aarch64-php8.3-cli-alpine -t aarch64php83alpine .
phanalist
:
docker run aarch64php83alpine /usr/bin/phanalist -h
And I got the expected output:
A static analyser for your PHP project
Usage: phanalist [OPTIONS]
Options:
-c, --config <CONFIG> [default: ./phanalist.yaml]
-s, --src <SRC> [default: ./src]
-r, --rules <RULES> The list of rules to use (by default it is used from config)
-o, --output-format <OUTPUT_FORMAT> Possible options: text, json [default: text]
--summary-only Output only summary
-q, --quiet Do not output the results
-h, --help Print help
-V, --version Print version
It confirms that the released binary runs fine in php:8.3-cli-alpine
. I am pretty sure it will also work for linux/x86_64
platform, but release/x86_64-unknown-linux-musl/phanalist
needs to be used in that case.
And seems like there are 2 issues in your report:
./vendor/denzyl/phanalist/release/x86_64-unknown-linux-gnu/phanalist
for php:8.3-cli-alpine
. Instead it should run release/aarch64-unknown-linux-musl/phanalist /usr/bin/phanalist
(musl
, but not gnu
). @denzyldick can you please look into it?/root/phanalist
?The simplest solution here might be to download release/x86_64-unknown-linux-musl/phanalist in your GitHub actions. And use that:
curl https://raw.githubusercontent.com/denzyldick/phanalist/main/release/x86_64-unknown-linux-musl/phanalist -o phanalist
./phanalist -h
@mleczakm can you please try it?
Fetching binary directly works, but I created fix to init.sh to cover all this problems anyway. Pull request is waiting for action :)
Thanks a lot! https://github.com/denzyldick/phanalist/pull/61 is merged, and it seems to resolve this issue.
Describe the bug I found it difficult to run script inside docker based on
php:8.3-cli-alpine
to use it in github actions. I've tried install it as composer dependency, it results in:or in
when script run directly, or in
when run as github actions step inside same container on Github Actions:
To Reproduce
php:8.3-cli-alpine
Expected behavior It should be possible to run script on cli alpine image with sh only using composer OR dependencies should be better described.
Desktop (please complete the following information):
Additional context As a workaround I managed to successfully run phanalist by copying it from docker container: