README.md 9.45 KB
Newer Older
Diego Hernandes's avatar
Diego Hernandes committed
1
# PHP Repositories for Alpine - by CODECASTS
Diego Hernandes's avatar
Diego Hernandes committed
2

Diego Hernandes's avatar
Diego Hernandes committed
3
**"Maybe Up-to-date, PHP packages for Alpine Linux."**
Diego Hernandes's avatar
Diego Hernandes committed
4

Diego Hernandes's avatar
Diego Hernandes committed
5
---
Diego Hernandes's avatar
Diego Hernandes committed
6

Diego Hernandes's avatar
Diego Hernandes committed
7
Maintained by **[@hernandev](https://github.com/hernandev)**. Based on **[Valery Kartel](https://github.com/vakartel)** scripts.
Diego Hernandes's avatar
Diego Hernandes committed
8
9

---
Diego Hernandes's avatar
Diego Hernandes committed
10

Diego Hernandes's avatar
Diego Hernandes committed
11
This project provides a simple alternative for running updated PHP on Alpine Linux.
Diego Hernandes's avatar
Diego Hernandes committed
12

Diego Hernandes's avatar
Diego Hernandes committed
13
We pack and release PHP versions as soon they are available on http://php.net. (At least, we try to.)
Diego Hernandes's avatar
Diego Hernandes committed
14

Diego Hernandes's avatar
Diego Hernandes committed
15
Additionally, many PECL extensions are also available as packages as well.
Diego Hernandes's avatar
Diego Hernandes committed
16

Diego Hernandes's avatar
Diego Hernandes committed
17
---
Diego Hernandes's avatar
Diego Hernandes committed
18

Diego Hernandes's avatar
Diego Hernandes committed
19
## Release Cycle
Diego Hernandes's avatar
Diego Hernandes committed
20

Diego Hernandes's avatar
Diego Hernandes committed
21
For short, this project will support **2 minor version of both PHP and Alpine**  at time.
Diego Hernandes's avatar
Diego Hernandes committed
22

Diego Hernandes's avatar
Diego Hernandes committed
23
## Available Repositories
Diego Hernandes's avatar
Diego Hernandes committed
24

Diego Hernandes's avatar
Diego Hernandes committed
25
26
27
28
29
30
31
| Alpine Version  | PHP Version  | Current Release                                                                                                                                            | Repository URL                                                                                     |
| -               | -            | -                                                                                                                                                          | -                                                                                                  |
| **`3.10`**      | **`7.4`**    | [![Download](https://api.bintray.com/packages/php-alpine/v3.10/php-7.4/images/download.svg) ](https://bintray.com/php-alpine/v3.10/php-7.4/_latestVersion) | [https://dl.bintray.com/php-alpine/v3.10/php-7.4](https://dl.bintray.com/php-alpine/v3.10/php-7.4) |
| **`3.9`**       | **`7.4`**    | [![Download](https://api.bintray.com/packages/php-alpine/v3.9/php-7.4/images/download.svg) ](https://bintray.com/php-alpine/v3.9/php-7.4/_latestVersion)   | [https://dl.bintray.com/php-alpine/v3.9/php-7.4](https://dl.bintray.com/php-alpine/v3.9/php-7.4)   |
| **`3.9`**       | **`7.3`**    | [![Download](https://api.bintray.com/packages/php-alpine/v3.9/php-7.3/images/download.svg) ](https://bintray.com/php-alpine/v3.9/php-7.3/_latestVersion)   | [https://dl.bintray.com/php-alpine/v3.9/php-7.3](https://dl.bintray.com/php-alpine/v3.9/php-7.3)   |
| **`3.8`**       | **`7.3`**    | [![Download](https://api.bintray.com/packages/php-alpine/v3.8/php-7.3/images/download.svg) ](https://bintray.com/php-alpine/v3.8/php-7.3/_latestVersion)   | [https://dl.bintray.com/php-alpine/v3.8/php-7.3](https://dl.bintray.com/php-alpine/v3.8/php-7.3)   |
| **`3.8`**       | **`7.2`**    | [![Download](https://api.bintray.com/packages/php-alpine/v3.8/php-7.2/images/download.svg) ](https://bintray.com/php-alpine/v3.8/php-7.2/_latestVersion)   | [https://dl.bintray.com/php-alpine/v3.8/php-7.2](https://dl.bintray.com/php-alpine/v3.8/php-7.2)   |
Diego Hernandes's avatar
Diego Hernandes committed
32

Diego Hernandes's avatar
readme    
Diego Hernandes committed
33
34
> Alpine v3.7 is now deprecated and removed from this documentation. Your scripts will not stop working since the files are still available but they will not be receiving new builds from now on.
> PHP 7.1.x is now deprecated and removed from this documentation. Your scripts will not stop working since the files are still available but they will not be receiving new builds from now on.
Diego Hernandes's avatar
Diego Hernandes committed
35
> PHP 7.0.x is now deprecated and removed from this documentation. Your scripts will not stop working since the files are still available but they will not be receiving new builds from now on.
Diego Hernandes's avatar
Diego Hernandes committed
36

Diego Hernandes's avatar
Diego Hernandes committed
37
---
Diego Hernandes's avatar
Diego Hernandes committed
38

Fabio Vedovelli's avatar
Fabio Vedovelli committed
39
> Each version is available on a separate repository, choose the one you want and follow the instructions below:
Diego Hernandes's avatar
Diego Hernandes committed
40

Diego Hernandes's avatar
Diego Hernandes committed
41
42
43
44
45
46
47
48
49
50
51
52
## Repository Conflicts

In some cases, the packages on the repositories may present conflicts with official packages.

To solve that, each page was aliases as `php-name`, without the `7` indicator.

Considering this, all installs are now encouraged to reference the virtual names when installing.

The examples on this documentation are now updated to reflect this decision.

The original names are kept, and it should not break working scripts.

Diego Hernandes's avatar
Diego Hernandes committed
53
54
55
56
## Snippets

The following code snippets are intended for quick usage on either shell scripts or Dockerfile

Diego Hernandes's avatar
Diego Hernandes committed
57
58
> Notice that `main` and `community` official repositories must be enabled.

Diego Hernandes's avatar
Diego Hernandes committed
59
60
### Dockerfile

Diego Hernandes's avatar
Diego Hernandes committed
61
You may skip the ca-certificates part if you replace HTTPS by HTTP but you should not. PHP packages will eventually install ca-certificates anyway.
Diego Hernandes's avatar
Diego Hernandes committed
62
63

```dockerfile
64
# Versions 3.8 and 3.7 are current stable supported versions.
Diego Hernandes's avatar
Diego Hernandes committed
65
FROM alpine:3.9
Diego Hernandes's avatar
Diego Hernandes committed
66
67

# trust this project public key to trust the packages.
Diego Hernandes's avatar
Diego Hernandes committed
68
ADD https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
Diego Hernandes's avatar
Diego Hernandes committed
69
70
71
72
73
74
75

## you may join the multiple run lines here to make it a single layer

# make sure you can use HTTPS
RUN apk --update add ca-certificates

# add the repository, make sure you replace the correct versions if you want.
Diego Hernandes's avatar
Diego Hernandes committed
76
RUN echo "https://dl.bintray.com/php-alpine/v3.9/php-7.3" >> /etc/apk/repositories
Diego Hernandes's avatar
Diego Hernandes committed
77
78

# install php and some extensions
Diego Hernandes's avatar
Diego Hernandes committed
79
80
81
RUN apk add --update php
RUN apk add --update php-mbstring
RUN apk add --update php-you-extension-name-here
Diego Hernandes's avatar
Diego Hernandes committed
82
```
Diego Hernandes's avatar
Diego Hernandes committed
83

Diego Hernandes's avatar
Diego Hernandes committed
84
### Bash / Shell scripting
Diego Hernandes's avatar
Diego Hernandes committed
85

Diego Hernandes's avatar
Diego Hernandes committed
86
> You may skip the ca-certificates part if you replace HTTPS by HTTP but you should not. PHP packages will eventually install ca-certificates anyway.
87

Diego Hernandes's avatar
Diego Hernandes committed
88

Diego Hernandes's avatar
Diego Hernandes committed
89
```bash
Diego Hernandes's avatar
Diego Hernandes committed
90
#!/usr/bin/env sh
91

Diego Hernandes's avatar
Diego Hernandes committed
92
93
# install curl and certificates to download the key
apk add --update curl ca-certificates
Diego Hernandes's avatar
Diego Hernandes committed
94

Diego Hernandes's avatar
Diego Hernandes committed
95
# download the repository public key
Diego Hernandes's avatar
Diego Hernandes committed
96
curl https://dl.bintray.com/php-alpine/key/php-alpine.rsa.pub -o /etc/apk/keys/php-alpine.rsa.pub
Diego Hernandes's avatar
Diego Hernandes committed
97

Diego Hernandes's avatar
Diego Hernandes committed
98
# add the repository for the php / alpine version corresponding
Diego Hernandes's avatar
Diego Hernandes committed
99
echo "https://dl.bintray.com/php-alpine/v3.9/php-7.3" >> /etc/apk/repositories
Diego Hernandes's avatar
Diego Hernandes committed
100

Diego Hernandes's avatar
Diego Hernandes committed
101
# install packages
Diego Hernandes's avatar
Diego Hernandes committed
102
103
104
apk add --update php
apk add --update php-redis
apk add --update php-any-other-extension
Diego Hernandes's avatar
Diego Hernandes committed
105

Diego Hernandes's avatar
Diego Hernandes committed
106
107
```

108
109
110

## Available Packages

Diego Hernandes's avatar
Diego Hernandes committed
111
112
This is the complete available packages list:

Diego Hernandes's avatar
Diego Hernandes committed
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
| Package Name          | Type            |
| -                     | -               |
| `php`                 | PHP Core        |
| `php-common`          | PHP Core        |
| `php-fpm`             | PHP Core        |
| `php-cgi`             | PHP Core        |
| `php-apache2`         | PHP Core        |
| `php-doc`             | PHP Core        |
| `php-dev`             | PHP Core        |
|  -                    |                 |
| `php-sodium`          | Core Extension  |
| `php-bcmath`          | Core Extension  |
| `php-bz2`             | Core Extension  |
| `php-calendar`        | Core Extension  |
| `php-ctype`           | Core Extension  |
| `php-curl`            | Core Extension  |
| `php-dba`             | Core Extension  |
| `php-dom`             | Core Extension  |
| `php-embed`           | Core Extension  |
| `php-enchant`         | Core Extension  |
| `php-exif`            | Core Extension  |
| `php-ftp`             | Core Extension  |
| `php-gd`              | Core Extension  |
| `php-gettext`         | Core Extension  |
| `php-gmp`             | Core Extension  |
| `php-iconv`           | Core Extension  |
| `php-imap`            | Core Extension  |
| `php-intl`            | Core Extension  |
| `php-json`            | Core Extension  |
| `php-ldap`            | Core Extension  |
| `php-litespeed`       | Core Extension  |
| `php-mbstring`        | Core Extension  |
| `php-mcrypt`          | Core Extension  |
| `php-mysqli`          | Core Extension  |
| `php-mysqlnd`         | Core Extension  |
| `php-odbc`            | Core Extension  |
| `php-opcache`         | Core Extension  |
| `php-openssl`         | Core Extension  |
| `php-pcntl`           | Core Extension  |
| `php-pdo`             | Core Extension  |
| `php-pdo_dblib`       | Core Extension  |
| `php-pdo_mysql`       | Core Extension  |
| `php-pdo_pgsql`       | Core Extension  |
| `php-pdo_sqlite`      | Core Extension  |
| `php-pear`            | Core Extension  |
| `php-pgsql`           | Core Extension  |
| `php-phar`            | Core Extension  |
| `php-phpdbg`          | Core Extension  |
| `php-posix`           | Core Extension  |
| `php-pspell`          | Core Extension  |
| `php-session`         | Core Extension  |
| `php-shmop`           | Core Extension  |
| `php-snmp`            | Core Extension  |
| `php-soap`            | Core Extension  |
| `php-sockets`         | Core Extension  |
| `php-sqlite3`         | Core Extension  |
| `php-sysvmsg`         | Core Extension  |
| `php-sysvsem`         | Core Extension  |
| `php-tidy`            | Core Extension  |
| `php-wddx`            | Core Extension  |
| `php-xml`             | Core Extension  |
| `php-xmlreader`       | Core Extension  |
| `php-xmlrpc`          | Core Extension  |
| `php-xsl`             | Core Extension  |
| `php-zip`             | Core Extension  |
| `php-zlib`            | Core Extension  |
|  -                    |                 |
| `php-amqp`            | Extra Extension |
| `php-apcu`            | Extra Extension |
| `php-ast`             | Extra Extension |
| `php-ds`              | Extra Extension |
| `php-imagick`         | Extra Extension |
| `php-mailparse`       | Extra Extension |
| `php-memcached`       | Extra Extension |
| `php-mongodb`         | Extra Extension |
| `php-msgpack`         | Extra Extension |
| `php-psr`             | Extra Extension |
| `php-phalcon`         | Extra Extension |
| `php-redis`           | Extra Extension |
| `php-ssh2`            | Extra Extension |
| `php-swoole`          | Extra Extension |
| `php-timecop`         | Extra Extension |
| `php-libsodium`       | Extra Extension |
| `php-scalar_objects`  | Extra Extension |
| `php-secp256k1`       | Extra Extension |
| `php-xdebug`          | Extra Extension |
|  -                    |                 |
| `argon2`              | Extra Package   |
| `argon2-dev`          | Extra Package   |
| `libargon2`           | Extra Package   |
| `secp256k1`           | Extra Package   |

Diego Hernandes's avatar
Diego Hernandes committed
205

Diego Hernandes's avatar
Diego Hernandes committed
206
> Life's good!