README.md 9.39 KB
Newer Older
Diego Hernandes's avatar
Diego Hernandes committed
1
## PHP-ALPINE: Fresh PHP binaries APK repository for Alpine Linux.
Diego Hernandes's avatar
Diego Hernandes committed
2

3
**Currently Supporting PHP 8.1**, also, PHP 8.0 and PHP 7.4.
Diego Hernandes's avatar
Diego Hernandes committed
4

Diego Hernandes's avatar
Diego Hernandes committed
5
This project provides a simple alternative for running updated PHP binaries on Alpine Linux.
Diego Hernandes's avatar
Diego Hernandes committed
6
7
We pack and release PHP versions as soon they are available on http://php.net. (At least, we try to.)
Additionally, many PECL extensions are also available as packages as well.
Diego Hernandes's avatar
Diego Hernandes committed
8

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

#### Created by:
  - Diego Hernandes - **[@hernandev](https://github.com/hernandev)**
  
#### Support, Help and Faith:
  - Ueli Banholzer - **[@xarem](https://github.com/xarem)** 
  - whatwedo GmbH - **[@whatwedo](https://github.com/whatwedo)**
  - individual [contributors](https://github.com/codecasts/php-alpine/graphs/contributors)


#### Main Related Projects:
- **[Ambientum](https://github.com/ambientum/ambientum)** by [@hernandev](https://github.com/hernandev) 
  Docker native solution for running Laravel projects. From Development to Production. 

- **[DDE](https://github.com/whatwedo/dde)** by [@whatwedo](https://github.com/whatwedo) 
  Local development environment toolset based on Docker


Diego Hernandes's avatar
Diego Hernandes committed
27
---
Diego Hernandes's avatar
Diego Hernandes committed
28
29


Diego Hernandes's avatar
Diego Hernandes committed
30
## APK Repositories & Release Cycle
Diego Hernandes's avatar
Diego Hernandes committed
31

32
33
34
35
36
37
38
39
### PHP 8.1

| Alpine | PHP | Repository URL
| - | - | -
| ![Alpine 3.14](https://img.shields.io/badge/Alpine-v3.14-blue?style=flat-square) | ![PHP 8.1](https://img.shields.io/badge/PHP-8.1-blueviolet?style=flat-square) | [`php.hernandev.com/v3.14/php-8.1`](https://php.hernandev.com/v3.14/php-8.1)
| ![Alpine 3.13](https://img.shields.io/badge/Alpine-v3.13-blue?style=flat-square) | ![PHP 8.1](https://img.shields.io/badge/PHP-8.1-blueviolet?style=flat-square) | [`php.hernandev.com/v3.13/php-8.1`](https://php.hernandev.com/v3.13/php-8.1)
| ![Alpine 3.12](https://img.shields.io/badge/Alpine-v3.12-blue?style=flat-square) | ![PHP 8.1](https://img.shields.io/badge/PHP-8.1-blueviolet?style=flat-square) | [`php.hernandev.com/v3.12/php-8.1`](https://php.hernandev.com/v3.12/php-8.1)

Diego Hernandes's avatar
Diego Hernandes committed
40

Diego Hernandes's avatar
Diego Hernandes committed
41
### PHP 8.0
Diego Hernandes's avatar
Diego Hernandes committed
42

Diego Hernandes's avatar
Diego Hernandes committed
43
44
| Alpine | PHP | End of Support | Repository URL
| - | - | - | -
Diego Hernandes's avatar
Diego Hernandes committed
45
46
| ![Alpine 3.12](https://img.shields.io/badge/Alpine-v3.12-blue?style=flat-square) | ![PHP 8.0](https://img.shields.io/badge/PHP-8.0-blueviolet?style=flat-square) | ![EOS](https://img.shields.io/badge/EOS-2022--05--01-success?style=flat-square) | [`php.hernandev.com/v3.12/php-8.0`](https://php.hernandev.com/v3.12/php-8.0)
| ![Alpine 3.11](https://img.shields.io/badge/Alpine-v3.11-blue?style=flat-square) | ![PHP 8.0](https://img.shields.io/badge/PHP-8.0-blueviolet?style=flat-square) | ![EOS](https://img.shields.io/badge/EOS-2021--11--01-success?style=flat-square) | [`php.hernandev.com/v3.11/php-8.0`](https://php.hernandev.com/v3.11/php-8.0)
Diego Hernandes's avatar
Diego Hernandes committed
47
48

### PHP 7.4
Diego Hernandes's avatar
Diego Hernandes committed
49

Diego Hernandes's avatar
Diego Hernandes committed
50
51
| Alpine | PHP | End of Support | Repository URL
| - | - | - | -
Diego Hernandes's avatar
Diego Hernandes committed
52
53
| ![Alpine 3.12](https://img.shields.io/badge/Alpine-v3.12-blue?style=flat-square) | ![PHP 7.4](https://img.shields.io/badge/PHP-7.4-blueviolet?style=flat-square)  | ![EOS](https://img.shields.io/badge/EOS-2021--11--01-success?style=flat-square) | [`php.hernandev.com/v3.11/php-7.4`](https://php.hernandev.com/v3.11/php-7.4)
| ![Alpine 3.10](https://img.shields.io/badge/Alpine-v3.10-blue?style=flat-square) | ![PHP 7.4](https://img.shields.io/badge/PHP-7.4-blueviolet?style=flat-square)  | ![EOS](https://img.shields.io/badge/EOS-2021--11--01-success?style=flat-square) | [`php.hernandev.com/v3.10/php-7.4`](https://php.hernandev.com/v3.10/php-7.4)
Diego Hernandes's avatar
Diego Hernandes committed
54

Diego Hernandes's avatar
Diego Hernandes committed
55
### PHP 7.3
Diego Hernandes's avatar
Diego Hernandes committed
56

Diego Hernandes's avatar
Diego Hernandes committed
57
58
| Alpine | PHP | End of Support | Repository URL
| - | - | - | -
Diego Hernandes's avatar
Diego Hernandes committed
59
60
| ![Alpine 3.11](https://img.shields.io/badge/Alpine-v3.11-blue?style=flat-square) | ![PHP 7.3](https://img.shields.io/badge/PHP-7.3-blueviolet?style=flat-square) | ![EOS](https://img.shields.io/badge/EOS-2021--05--01-success?style=flat-square) | [`php.hernandev.com/v3.11/php-7.3`](https://php.hernandev.com/v3.11/php-7.3)
| ![Alpine 3.10](https://img.shields.io/badge/Alpine-v3.10-blue?style=flat-square) | ![PHP 7.3](https://img.shields.io/badge/PHP-7.3-blueviolet?style=flat-square) | ![EOS](https://img.shields.io/badge/EOS-2020--12--06-red?style=flat-square) | [`php.hernandev.com/v3.10/php-7.3`](https://php.hernandev.com/v3.10/php-7.3)
Diego Hernandes's avatar
Diego Hernandes committed
61

Diego Hernandes's avatar
Diego Hernandes committed
62

Diego Hernandes's avatar
Diego Hernandes committed
63
64
65
Builds are available as soon as possible, and EOS is determined by:
- If either PHP or Alpine release reaches end of support, the repository will stop receiving updates.
- Support for both PHP and Alpine are estimated for around 2 years from release date.
Diego Hernandes's avatar
Diego Hernandes committed
66

Diego Hernandes's avatar
Diego Hernandes committed
67
Active support reference:
Diego Hernandes's avatar
Diego Hernandes committed
68

Diego Hernandes's avatar
Diego Hernandes committed
69
70
- PHP: https://www.php.net/supported-versions.php
- Alpine: https://wiki.alpinelinux.org/wiki/Alpine_Linux:Releases  
Diego Hernandes's avatar
Diego Hernandes committed
71

Diego Hernandes's avatar
Diego Hernandes committed
72
> Replace examples below with desired Alpine and PHP versions.
Diego Hernandes's avatar
Diego Hernandes committed
73
74


Diego Hernandes's avatar
Diego Hernandes committed
75
76
77
78
## Snippets

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

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

Diego Hernandes's avatar
Diego Hernandes committed
81
82
### Dockerfile

Diego Hernandes's avatar
Diego Hernandes committed
83
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
84
85

```dockerfile
Diego Hernandes's avatar
Diego Hernandes committed
86
FROM alpine:3.11
Diego Hernandes's avatar
Diego Hernandes committed
87

Diego Hernandes's avatar
Diego Hernandes committed
88
ADD https://php.hernandev.com/key/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub
Diego Hernandes's avatar
Diego Hernandes committed
89

mtgto's avatar
mtgto committed
90
RUN apk --update-cache add ca-certificates && \
Diego Hernandes's avatar
Diego Hernandes committed
91
    echo "https://php.hernandev.com/v3.11/php-7.4" >> /etc/apk/repositories
Diego Hernandes's avatar
Diego Hernandes committed
92
93

# install php and some extensions
mtgto's avatar
mtgto committed
94
RUN apk add --update-cache \
Diego Hernandes's avatar
Diego Hernandes committed
95
96
97
98
99
    php \
    php-bz2 \
    php-json \
    php-mysql \
    php-any-other-available-package... 
Diego Hernandes's avatar
Diego Hernandes committed
100
101
```

102
103
104

## Available Packages

Diego Hernandes's avatar
Diego Hernandes committed
105
106
This is the complete available packages list:

Diego Hernandes's avatar
Diego Hernandes committed
107
108
109
110
111
112
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
| 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 |
Nyholm's avatar
Nyholm committed
183
| `php-pcov`            | Extra Extension |
Diego Hernandes's avatar
Diego Hernandes committed
184
| `php-phalcon`         | Extra Extension |
Nyholm's avatar
Nyholm committed
185
| `php-psr`             | Extra Extension |
Diego Hernandes's avatar
Diego Hernandes committed
186
187
188
189
190
191
192
193
194
195
196
| `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   |
Ueli Banholzer's avatar
Ueli Banholzer committed
197
198
199
| `enchant`             | Extra Package   |
| `enchant-doc`         | Extra Package   |
| `enchant-dev`         | Extra Package   |
Diego Hernandes's avatar
Diego Hernandes committed
200
| `libargon2`           | Extra Package   |
201
| `libsecp256k1`        | Extra Package   |
Diego Hernandes's avatar
Diego Hernandes committed
202

Diego Hernandes's avatar
Diego Hernandes committed
203

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