Stories

Detail Return Return

Laravel10 docker鏡像 - Stories Detail

查看官方文檔 獲取php版本要求https://laravel.com/docs/10.x/installation

laravel10 安裝指南

1:本地已經有laravel項目

將項目打包成鏡像文件,用於後續k8s等環境部署

參考 這裏 https://github.com/docker-library-tim/laravel10

使用基礎鏡像:docker pull xiaotim/php-base:php8.2

#  php82 composer.phar create-project laravel/laravel:^10.0 laravel10-app
# 增加配置文件 
#    Dockerfile
#    nginx.conf
#    php-fpm.conf

# 本地驗證
sudo docker build -t my-laravel-10:v1 .

# 啓動容器
sudo docker start xxxx

# 查看容器ip
sudo docker inspect xxxx

# 驗證
curl  http://192.168.16.2/

2:沒有php環境,從零開始安裝以及構建docker鏡像(待補充)

user avatar soroqer Avatar crossoverjie Avatar meiyoufujideyidongdianyuan Avatar litao_2071 Avatar youngcoding Avatar shendaowu Avatar changhao_flag Avatar phpnan Avatar niandou Avatar tekin_cn Avatar codechen8848 Avatar flydehuli Avatar
Favorites 12 users favorite the story!
Favorites

Add a new Comments

Some HTML is okay.