|
1 |
| -### Create AMD and ARM builds with buildx |
2 |
| -``` |
3 |
| -docker buildx build --platform="linux/amd64" -t atyantik/laravel-php:8.3-bullseye-amd64 . |
4 |
| -``` |
| 1 | +# Atyantik's Laravel PHP Docker Image 🌟 |
| 2 | + |
| 3 | +[](https://hub.docker.com/repository/docker/atyantik/laravel-php) |
| 4 | + |
| 5 | +This repository provides a **custom PHP 8.4 Docker image** based on the Bullseye distribution, optimized for running Laravel applications. It includes pre-installed PHP extensions, tools, and multi-architecture support for **AMD64** and **ARM64**. 🚀 |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## ✨ Features: What This Dockerfile Provides |
| 10 | + |
| 11 | +This Dockerfile is tailored for **Laravel** applications and includes the following features: |
| 12 | + |
| 13 | +1. **PHP 8.4** with FPM (FastCGI Process Manager). |
| 14 | +2. ✅ **Pre-installed PHP Extensions**: |
| 15 | + - Essential extensions required by most Laravel applications. |
| 16 | + - See the [Extension Table](#php-extensions) below for a full list. 🧩 |
| 17 | +3. ✅ **Pre-installed Tools**: |
| 18 | + - **Composer** (globally available for dependency management). |
| 19 | + - **MongoDB Tools** (e.g., `mongodump`) for database backups and operations. |
| 20 | +4. ✅ **Xdebug**: |
| 21 | + - Included but disabled by default for production readiness. |
| 22 | + - XDebug 3.4.0beta1 is used for compatibility with php 8.4 |
| 23 | +5. ✅ **Multi-Architecture Builds**: |
| 24 | + - Supports both AMD64 (x86_64) and ARM64 (aarch64) architectures. |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## 🧩 PHP Extensions |
| 29 | + |
| 30 | +Here’s a detailed list of pre-installed PHP extensions: |
| 31 | + |
| 32 | +| Extension | Description | Status | |
| 33 | +|----------------------|-------------------------------------------------------|--------| |
| 34 | +| **pdo_mysql** | MySQL database support | ✅ | |
| 35 | +| **pdo_pgsql** | PostgreSQL database support | ✅ | |
| 36 | +| **pdo_sqlite** | SQLite lightweight database support | ✅ | |
| 37 | +| **mbstring** | Multibyte string handling for UTF-8 support | ✅ | |
| 38 | +| **intl** | Internationalization and localization features | ✅ | |
| 39 | +| **gd** | Image processing (JPEG, PNG) | ✅ | |
| 40 | +| **zip** | Support for ZIP compression | ✅ | |
| 41 | +| **opcache** | Performance optimization through script caching | ✅ | |
| 42 | +| **soap** | SOAP-based web services | ✅ | |
| 43 | +| **redis** | Redis for caching and sessions | ✅ | |
| 44 | +| **memcached** | Memcached for caching and sessions | ✅ | |
| 45 | +| **mongodb** | MongoDB database support | ✅ | |
| 46 | +| **gmp** | Arbitrary precision arithmetic | ✅ | |
| 47 | +| **exif** | Metadata handling for images | ✅ | |
| 48 | + |
| 49 | +--- |
| 50 | + |
| 51 | +## 🛠 Pre-installed Tools |
| 52 | + |
| 53 | +1. **Composer**: |
| 54 | + - Installed globally for dependency management. |
| 55 | + - Optimized to use only HTTPS for Packagist repositories. |
| 56 | + |
| 57 | +2. **MongoDB Tools**: |
| 58 | + - Includes **mongodump** for backup operations and other utilities. |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## 🚀 How to Use |
5 | 63 |
|
| 64 | +This Docker image is available on [Docker Hub](https://hub.docker.com/repository/docker/atyantik/laravel-php). You can pull it directly or use it as a base image in your own Dockerfile: |
| 65 | + |
| 66 | +```dockerfile |
| 67 | +FROM atyantik/laravel-php:8.4-bullseye |
6 | 68 | ```
|
7 |
| -docker buildx build --platform="linux/arm64" -t atyantik/laravel-php:8.3-bullseye-arm64 . |
8 |
| -``` |
9 | 69 |
|
10 |
| -### Push both to docker hub |
11 |
| -docker push atyantik/laravel-php:8.3-bullseye-arm64 |
12 |
| -docker push atyantik/laravel-php:8.3-bullseye-amd64 |
| 70 | +### Example: Running a Laravel Application |
| 71 | + |
| 72 | +1. Build your Laravel application image using this base image: |
| 73 | + ```dockerfile |
| 74 | + FROM atyantik/laravel-php:8.4-bullseye |
| 75 | + |
| 76 | + COPY . /var/www/html |
| 77 | + WORKDIR /var/www/html |
| 78 | + |
| 79 | + RUN composer install --no-dev --optimize-autoloader |
| 80 | + ``` |
| 81 | +2. Start the container: |
| 82 | + ```bash |
| 83 | + docker run -p 8000:9000 my-laravel-app |
| 84 | + ``` |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## 🛠 Compilation Steps |
| 89 | + |
| 90 | +Follow these steps to build the image yourself: |
| 91 | + |
| 92 | +1. **Clone the Repository**: |
| 93 | + ```bash |
| 94 | + git clone https://github.com/atyantik/laravel-php-docker.git |
| 95 | + cd laravel-php-docker |
| 96 | + ``` |
| 97 | + |
| 98 | +2. **Enable Buildx for Multi-Architecture Builds**: |
| 99 | + - If Buildx is not set up, enable it by following [Docker's Buildx Guide](https://docs.docker.com/buildx/working-with-buildx/). |
| 100 | + |
| 101 | +3. **Build AMD64 Image**: |
| 102 | + ```bash |
| 103 | + docker buildx build --platform="linux/amd64" -t atyantik/laravel-php:8.4-bullseye-amd64 . |
| 104 | + ``` |
| 105 | + |
| 106 | +4. **Build ARM64 Image**: |
| 107 | + ```bash |
| 108 | + docker buildx build --platform="linux/arm64" -t atyantik/laravel-php:8.4-bullseye-arm64 . |
| 109 | + ``` |
| 110 | + |
| 111 | +5. **Push Images to Docker Hub**: |
| 112 | + ```bash |
| 113 | + docker push atyantik/laravel-php:8.4-bullseye-amd64 |
| 114 | + docker push atyantik/laravel-php:8.4-bullseye-arm64 |
| 115 | + ``` |
| 116 | + |
| 117 | +6. **Create and Push a Manifest for Multi-Architecture**: |
| 118 | + ```bash |
| 119 | + docker manifest create atyantik/laravel-php:8.4-bullseye \ |
| 120 | + atyantik/laravel-php:8.4-bullseye-amd64 \ |
| 121 | + atyantik/laravel-php:8.4-bullseye-arm64 |
| 122 | + docker manifest push atyantik/laravel-php:8.4-bullseye |
| 123 | + ``` |
| 124 | + |
| 125 | +--- |
| 126 | + |
| 127 | +## 🌐 Links |
| 128 | + |
| 129 | +- **Docker Hub Repository**: [https://hub.docker.com/repository/docker/atyantik/laravel-php](https://hub.docker.com/repository/docker/atyantik/laravel-php) |
| 130 | +- **Atyantik Technologies**: [atyantik.com](https://atyantik.com) |
13 | 131 |
|
| 132 | +--- |
14 | 133 |
|
15 |
| -`// docker manifest rm atyantik/laravel-php:8.3 atyantik/laravel-php:8.3-bullseye-amd64 atyantik/laravel-php:8.3-bullseye-arm64` |
| 134 | +## 🤝 About Atyantik Technologies |
16 | 135 |
|
17 |
| -docker manifest create atyantik/laravel-php:8.3-bullseye atyantik/laravel-php:8.3-bullseye-amd64 atyantik/laravel-php:8.3-bullseye-arm64 |
| 136 | + |
18 | 137 |
|
19 |
| -docker manifest push atyantik/laravel-php:8.3-bullseye |
| 138 | +At **Atyantik Technologies**, we specialize in building world-class software solutions with a focus on innovation, scalability, and efficiency. We believe in delivering value through cutting-edge technologies and industry best practices. |
20 | 139 |
|
| 140 | +💻 Visit us at: [atyantik.com](https://atyantik.com) |
0 commit comments