codecasts / php-alpine

PHP APK Repository for Alpine Linux
https://github.com/codecasts/php-alpine
482 stars 58 forks source link

apk add php@php in alpine3.9 php7.3 installs php7 (7.2.14-r0) #69

Closed keithy closed 4 years ago

keithy commented 5 years ago

I have a build which allows you to select which modules that you wish to load.

./alpine3.x_php7.x.sh php_all 3.9 7.3 build

The above loads all of the modules and some. This works fine!

./alpine3.x_php7.x.sh php_base 3.9 7.3 build

The above script loads NO modules, just php@php and apk goes and gets (11/14) Installing php7 (7.2.14-r0)

The solution is to ensure that you at least load php-common@php this does work.

keithy commented 5 years ago

To reproduce FAILURE, copying from the README bash script.

docker run -ti --rm alpine:3.9

apk add --update curl ca-certificates
curl https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub -o /etc/apk/keys/php-alpine.rsa.pub
echo "@php https://dl.bintray.com/php-alpine/v3.9/php-7.3" >> /etc/apk/repositories
apk add --update php@php

Output:

fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
fetch https://dl.bintray.com/php-alpine/v3.9/php-7.3/x86_64/APKINDEX.tar.gz
(1/8) Installing php7-common (7.2.14-r0)
(2/8) Installing ncurses-terminfo-base (6.1_p20190105-r0)
(3/8) Installing ncurses-terminfo (6.1_p20190105-r0)
(4/8) Installing ncurses-libs (6.1_p20190105-r0)
(5/8) Installing libedit (20181209.3.1-r0)
(6/8) Installing pcre (8.42-r1)
(7/8) Installing libxml2 (2.9.9-r1)
(8/8) Installing php7 (7.2.14-r0)
Executing busybox-1.29.3-r10.trigger
OK: 21 MiB in 27 packages
keithy commented 5 years ago

To reproduce SUCCESS, copying from the README bash script.

docker run -ti --rm alpine:3.9

apk add --update curl ca-certificates
curl https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub -o /etc/apk/keys/php-alpine.rsa.pub
echo "@php https://dl.bintray.com/php-alpine/v3.9/php-7.3" >> /etc/apk/repositories
apk add --update php-common@php

Output:

fetch https://dl.bintray.com/php-alpine/v3.9/php-7.3/x86_64/APKINDEX.tar.gz
(1/1) Installing php7-common@php (7.3.3-r1)
OK: 7 MiB in 20 packages

And then all is well:

/ # apk add --update php@php
(1/8) Installing argon2-libs (20171227-r1)
(2/8) Installing ncurses-terminfo-base (6.1_p20190105-r0)
(3/8) Installing ncurses-terminfo (6.1_p20190105-r0)
(4/8) Installing ncurses-libs (6.1_p20190105-r0)
(5/8) Installing libedit (20181209.3.1-r0)
(6/8) Installing pcre2 (10.32-r1)
(7/8) Installing libxml2 (2.9.9-r1)
(8/8) Installing php7@php (7.3.3-r1)
Executing busybox-1.29.3-r10.trigger
OK: 36 MiB in 28 packages
glensc commented 5 years ago

looks like duplicate: https://github.com/codecasts/php-alpine/issues/72

hernandev commented 4 years ago

you can use the code samples for building, they are correctly set on each version cause of the naming conflicts.

If still erroring, use https://github.com/ambientum/ambientum as reference for a Dockerfile install of each version.

hernandev commented 4 years ago

@glensc thanks for pointing out the other issue.

but TL;DR; on the conflicts.

  1. If the current alpine version has PHP packages one or more minor releases older, then the this project's packages will install ok:

example, default PHP on alpine 3.x is 7.2, and you're installing 7.3 from this project, you will be fine and not need @php

  1. If the Alpine packages and this packages are the same minor release, then @php will actually out less weight / precedence and also the bugfix number x.x.9 x.x.10 will play a role.
hernandev commented 4 years ago

real solution, having a different naming structure