今天要來實作一下laravel-php上到azure docker的實作,參考
FROM php:7
可以依照自已的php版本調整agt-get區塊
安裝laravel所需的pre-requestcurl區塊
安裝composerpdo、mbstring
composer install
FROM php:7
RUN apt-get update -y && apt-get install -y openssl zip unzip git
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN docker-php-ext-install pdo mbstring
WORKDIR /app
COPY . /app
RUN composer install
CMD php artisan serve --host=0.0.0.0 --port=80
EXPOSE 80
docker build -t myregistry.azurecr.io/php-test:v1 .
docker login --username myusername --password mypassword myregistry.azurecr.io
docker push myregistry.azurecr.io/php-test:v1