GithubHelp home page GithubHelp logo

laravel-docker's Introduction

laravel-docker

๐Ÿณ Generic docker image for Laravel Applications

Docker Badge

Tags PHP version Features
8.1 8.1 โœ… Everything.
8.2 8.2 โœ… Everything.
8.3 8.3 โš ๏ธ Everything but using xdebug-beta instead of xdebug-stable.
stable 8.2 ๐Ÿ”— Aliases the latest stable version of PHP that supports all features of this docker image.
latest 8.3 ๐Ÿ”— Aliases the latest stable version of PHP available (even if that version does not support all features yet).

Use within your GitLab's pipelines.

laravel-docker's People

Contributors

dependabot[bot] avatar edemots avatar felipehertzer avatar fgilio avatar kreitje avatar ksassnowski avatar lorisleiva avatar lukasleitsch avatar mnme avatar muffinman avatar negoziator avatar ragingdave avatar rbcunhadesign avatar synchro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-docker's Issues

php:8.0-alpine is released

php:8.0-alpine is released and this package is still using RC version.
RC version has problem with composer array_merge function.

Pecl packages are missing (No release available error)

Hello, I'm trying to build your images from source, but build is failing.

Steps to reproduce:

  1. Git clone your repo
  2. cd 7.2
  3. docker build -t .

Full output:

Sending build context to Docker daemon  238.6MB
Step 1/14 : FROM php:7.2-alpine
7.2-alpine: Pulling from library/php
8e402f1a9c57: Pull complete 
40247b69e7b1: Pull complete 
e26a8200283e: Pull complete 
e2666bd30975: Pull complete 
1f117533e4ad: Pull complete 
dfefe993b600: Pull complete 
d4319eb159f9: Pull complete 
b3d97113348e: Pull complete 
6eea37e4106c: Pull complete 
Digest: sha256:1e3b8e260ef1339aa585f03fcef7f0303f94be68b8d5615239f69f1d361553a0
Status: Downloaded newer image for php:7.2-alpine
 ---> dfc1490370a6
Step 2/14 : RUN apk add --no-cache --virtual .build-deps     $PHPIZE_DEPS     curl-dev     imagemagick-dev     libtool     libxml2-dev     postgresql-dev     sqlite-dev
 ---> Running in 4be179be729e
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/60) Installing m4 (1.4.18-r1)
(2/60) Installing libbz2 (1.0.6-r6)
(3/60) Installing perl (5.26.3-r0)
(4/60) Installing autoconf (2.69-r2)
(5/60) Installing pkgconf (1.6.0-r0)
(6/60) Installing dpkg-dev (1.19.2-r0)
(7/60) Installing dpkg (1.19.2-r0)
(8/60) Installing libmagic (5.35-r0)
(9/60) Installing file (5.35-r0)
(10/60) Installing libgcc (8.2.0-r2)
(11/60) Installing libstdc++ (8.2.0-r2)
(12/60) Installing binutils (2.31.1-r2)
(13/60) Installing gmp (6.1.2-r1)
(14/60) Installing isl (0.18-r0)
(15/60) Installing libgomp (8.2.0-r2)
(16/60) Installing libatomic (8.2.0-r2)
(17/60) Installing mpfr3 (3.1.5-r1)
(18/60) Installing mpc1 (1.0.3-r1)
(19/60) Installing gcc (8.2.0-r2)
(20/60) Installing musl-dev (1.1.20-r3)
(21/60) Installing libc-dev (0.7.1-r0)
(22/60) Installing g++ (8.2.0-r2)
(23/60) Installing make (4.2.1-r2)
(24/60) Installing re2c (1.1.1-r0)
(25/60) Upgrading libcrypto1.1 (1.1.1a-r1 -> 1.1.1b-r1)
(26/60) Upgrading libssl1.1 (1.1.1a-r1 -> 1.1.1b-r1)
(27/60) Installing openssl-dev (1.1.1b-r1)
(28/60) Installing zlib-dev (1.2.11-r1)
(29/60) Installing libssh2-dev (1.8.0-r4)
(30/60) Installing nghttp2-dev (1.35.1-r0)
(31/60) Installing curl-dev (7.64.0-r1)
(32/60) Installing libxau (1.0.8-r3)
(33/60) Installing libbsd (0.8.6-r2)
(34/60) Installing libxdmcp (1.1.2-r5)
(35/60) Installing libxcb (1.13-r2)
(36/60) Installing libx11 (1.6.7-r0)
(37/60) Installing libxext (1.3.3-r3)
(38/60) Installing expat (2.2.6-r0)
(39/60) Installing libpng (1.6.35-r0)
(40/60) Installing freetype (2.9.1-r2)
(41/60) Installing libuuid (2.33-r0)
(42/60) Installing fontconfig (2.13.1-r0)
(43/60) Installing lcms2 (2.9-r1)
(44/60) Installing libltdl (2.4.6-r5)
(45/60) Installing imagemagick-libs (7.0.8.23-r0)
(46/60) Installing imagemagick-c++ (7.0.8.23-r0)
(47/60) Installing imagemagick-dev (7.0.8.23-r0)
(48/60) Installing readline (7.0.003-r1)
(49/60) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(50/60) Installing libtool (2.4.6-r5)
(51/60) Installing libxml2-dev (2.9.9-r1)
(52/60) Installing db (5.3.28-r1)
(53/60) Installing libsasl (2.1.27-r1)
(54/60) Installing libldap (2.4.47-r2)
(55/60) Installing libpq (11.1-r0)
(56/60) Installing postgresql-libs (11.1-r0)
(57/60) Installing postgresql-dev (11.1-r0)
(58/60) Installing sqlite-libs (3.26.0-r3)
(59/60) Installing sqlite-dev (3.26.0-r3)
(60/60) Installing .build-deps (0)
Executing busybox-1.29.3-r10.trigger
Executing ca-certificates-20190108-r0.trigger
OK: 274 MiB in 88 packages
Removing intermediate container 4be179be729e
 ---> 62b636933a33
Step 3/14 : RUN apk add --no-cache     bash     curl     g++     gcc     git     imagemagick     libc-dev     libpng-dev     make     mysql-client     nodejs     nodejs-npm     yarn     openssh-client     postgresql-libs     rsync     zlib-dev     libzip-dev
 ---> Running in d1602620112f
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/52) Installing pcre2 (10.32-r1)
(2/52) Installing git (2.20.1-r0)
(3/52) Installing libxrender (0.9.10-r3)
(4/52) Installing pixman (0.34.0-r6)
(5/52) Installing cairo (1.16.0-r1)
(6/52) Installing libffi (3.2.1-r6)
(7/52) Installing libintl (0.19.8.1-r4)
(8/52) Installing libblkid (2.33-r0)
(9/52) Installing libmount (2.33-r0)
(10/52) Installing pcre (8.42-r1)
(11/52) Installing glib (2.58.1-r2)
(12/52) Installing dbus-libs (1.10.24-r1)
(13/52) Installing avahi-libs (0.7-r1)
(14/52) Installing nettle (3.4.1-r0)
(15/52) Installing p11-kit (0.23.14-r0)
(16/52) Installing libtasn1 (4.13-r0)
(17/52) Installing libunistring (0.9.10-r0)
(18/52) Installing gnutls (3.6.4-r0)
(19/52) Installing cups-libs (2.2.10-r0)
(20/52) Installing jbig2dec (0.15-r0)
(21/52) Installing libjpeg-turbo (1.5.3-r4)
(22/52) Installing tiff (4.0.10-r0)
(23/52) Installing ghostscript (9.26-r1)
(24/52) Installing libxft (2.3.2-r3)
(25/52) Installing fribidi (1.0.5-r0)
(26/52) Installing graphite2 (1.3.12-r1)
(27/52) Installing harfbuzz (2.2.0-r0)
(28/52) Installing pango (1.42.4-r0)
(29/52) Installing libcroco (0.6.12-r1)
(30/52) Installing shared-mime-info (1.10-r0)
(31/52) Installing gdk-pixbuf (2.36.11-r2)
(32/52) Installing librsvg (2.40.20-r0)
(33/52) Installing libwebp (1.0.1-r0)
(34/52) Installing imagemagick (7.0.8.23-r0)
(35/52) Installing libpng-dev (1.6.35-r0)
(36/52) Installing libzip (1.5.1-r2)
(37/52) Installing libzip-dev (1.5.1-r2)
(38/52) Installing mariadb-common (10.3.13-r0)
(39/52) Installing mariadb-client (10.3.13-r0)
(40/52) Installing mysql-client (10.3.13-r0)
(41/52) Installing c-ares (1.15.0-r0)
(42/52) Installing http-parser (2.8.1-r0)
(43/52) Installing libuv (1.23.2-r0)
(44/52) Installing nodejs (10.14.2-r0)
(45/52) Installing npm (10.14.2-r0)
(46/52) Installing openssh-keygen (7.9_p1-r4)
(47/52) Installing openssh-client (7.9_p1-r4)
(48/52) Installing libattr (2.4.47-r7)
(49/52) Installing libacl (2.2.52-r5)
(50/52) Installing popt (1.16-r7)
(51/52) Installing rsync (3.1.3-r1)
(52/52) Installing yarn (1.12.3-r0)
Executing busybox-1.29.3-r10.trigger
Executing fontconfig-2.13.1-r0.trigger
Executing glib-2.58.1-r2.trigger
Executing shared-mime-info-1.10-r0.trigger
Executing gdk-pixbuf-2.36.11-r2.trigger
OK: 448 MiB in 140 packages
Removing intermediate container d1602620112f
 ---> 0c049f524aa4
Step 4/14 : RUN pecl install     imagick     xdebug
 ---> Running in aa33f5064461
No releases available for package "pecl.php.net/imagick"
No releases available for package "pecl.php.net/xdebug"
install failed
The command '/bin/sh -c pecl install     imagick     xdebug' returned a non-zero code: 1

Build failing with the latest version

when running npm run production with the latest docker image I get the following error:

npm run production

> @ production /builds/XYZ/MY-PROJECT
> cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

 ERROR  Failed to compile with 2 errors10:48:46 AM

 error  in ./resources/assets/sass/theme.scss

Module build failed: Error: Missing binding /builds/XYZ/MY-PROJECT/node_modules/node-sass/vendor/linux_musl-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux/musl 64-bit with Node.js 10.x

Found bindings for the following environments:
  - Linux/musl 64-bit with Node.js 8.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
 

Are both node versions installed on this docker image? Node 8 and 10?

Anyway, on my end I fixed it by running npm rebuild node-sass just before npm run production. This generates an error about python missing but the npm build seems to complete.

  script:
    - npm install
    - npm rebuild node-sass
    - npm run production

PHPUNIT

Hello i am setting up a new project for build:test:deploy using your deployer and docker image, but i fount a problem and i am struggling with it ,the problem is with phpunit, my CI on gitlab is running until this ste
p.

chrome_qo0tjgqgmp

And i really wanna setup the unit tests... its a must have for me... any help will be most wellcome.

My CI Pipeline file is:

image: lorisleiva/laravel-docker:latest

.init_ssh: &init_ssh |
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh
chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config

.change_file_permissions: &change_file_permissions |
find . -type f -not -path "./vendor/" -exec chmod 664 {} ;
find . -type d -not -path "./vendor/
" -exec chmod 775 {} ;

cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- vendor/

composer:
stage: build
cache:
key: ${CI_COMMIT_REF_SLUG}-composer
paths:
- vendor/
script:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- cp .env.example .env
- php artisan key:generate
artifacts:
expire_in: 1 month
paths:
- vendor/
- .env

npm:
stage: build
cache:
key: ${CI_COMMIT_REF_SLUG}-npm
paths:
- node_modules/
script:
- npm install
- npm run production
artifacts:
expire_in: 1 month
paths:
- node_modules/
- public_html/css/
- public_html/js/

codestyle:
stage: test
cache: {}
dependencies: []
script:
- phpcs --standard=PSR2 --extensions=php --ignore=app/Support/helpers.php app

phpunit:
stage: test
dependencies:
- composer
script:
- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
- cp .env.example .env
- php artisan key:generate
- phpunit --coverage-text --colors=never

production:
stage: deploy
script:
- *init_ssh
- *change_file_permissions
- cp .env.production .env
- php artisan deploy .com.br -s upload
environment:
name: production
url: http://
.com.br
when: manual
only:

  • master

UploadedFile::fake() error

It will give this error when using UploadedFile::fake()->image('avatar.png') in testing

testing.ERROR: Call to undefined function Intervention\Image\Gd\imagejpeg()

Potential memory issues with 7.4

Note that this issue was original created to fix some missing dependencies of the new 7.4 image. Scroll down for the memory issue.

Original post below:


I'm not sure what exactly was including it but previous docker images had the exif extension as I am now getting (without any package changes between the last successful build and now):

- Installation request for spatie/image 1.7.5 -> satisfiable by spatie/image[1.7.5]. - spatie/image 1.7.5 requires ext-exif * -> the requested PHP extension exif is missing from your system.

The last successful build in the same repo was Jan 10, 2020 at 11AM EST. This is causing our pipeline to effectively die for no good reason other than a docker build image update. I unfortunately can't share much more than this as it's a private company repo. Additionally I looked the changes in the docker image for php7.3 (stable) and it seems nothing changed there.

Small update as I was writing this, it seems (based on looking at the compressed sizes on docker hub) that stable was replaced last night for 7.4. This seems to break most builds that were using stable and IMHO flies in the face of what "stable" even means. Would you be able to add back exif (as it previously was/is there in the 7.3 build) to the 7.4 build or perhaps just swap stable back to 7.3 until your 7.4 docker image has feature/extension parity with 7.3? This is basically nuking our pipeline right now and appears to have been an overnight change without any announcements to prepare.

requires ext-exif

I'm using spatie/laravel-sitemap, for that I need spatie/image.

Because of that I get the error:

  • spatie/image 1.7.4 requires ext-exif * -> the requested PHP extension exif is missing from your system.

Is it possible to add this to the docker or should I use my own fork?

add calendar extension?

I just ran into this where without the calendar extension, functions (such as the one I use, easter_days()) are missing? What's the possibility of having that added?

Please update phpcs

The lorisleiva/laravel-docker:latest image currently includes phpcs 3.5.3. Unfortunately my project is suffering from a phpcs bug that was fixed in 3.5.5 (released 2 weeks ago), and this means that the docker image is currently breaking my build. Could you update it please?

I noticed #46 mentioned using the project's own phpcs - that would fix my issue, but possibly break others.

[Vote] Imap extension

Hi,

Thank you for this image, and for your blog posts on gitlab integration, they where really useful.

Do you think it would be a good addition to have the imap extension as well?

Cheers.

lighthouse-ci

Lighthouse-ci support would be a great addition. I know, we can fork the image and do it ourselves but this way everyone would have access to it.
Thanks for the great work so far

Docker-Compose

Good friend, you will have an example of how to mount my Laravel APP that I have in GITLAB with your Dockerfile or some Docker-compose that you have an example of how to deploy an APP

Thank you

Segmentation fault with 7.1

Hello,

I'm very new to Gitlab CI and I found your article great. Although I tried to setup a simple gitlab CI using the 7.1 (as I want my project to be compatible with this version of PHP), I setup the Gitlab CI yml like this :

image: lorisleiva/laravel-docker:7.1

cache:
  key: ${CI_COMMIT_REF_SLUG}
  paths:
    - vendor/

phpunit:
  stage: test
  script:
    - composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
    - cp .env.example .env
    - php artisan key:generate
    - phpunit --coverage-text --colors=never

In this case (using 7.1 instead of latest) the test suite failed returning a Segmentation fault
If I switch 7.1 for latest everything is working fine, did I do something wrong ?

Missing ext-http extension

I get missing ext-http extension

+ php composer.phar install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts --optimize-autoloader
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.
  Problem 1
    - Root composer.json requires PHP extension ext-http * but it is missing from your system. Install or enable PHP's http extension.

on lorisleiva/laravel-docker:latest

Odd issue: `artisan` not foound in container

I have build the 7.3 and 7.4 containers, and both behave the same.

When I run the container with a mounted project drive, the artisan command simply cannot be seen in the container. It is there on my host (Windows) directory. I can see it in the container if I rename it, but any file called artisan is simply invisible.

Any idea what could be causing that? From Powershell it looks like this:

PS C:\Users\jason> docker run --rm --name my-app -v C:\Projects\my-app:/var/www/html -w /var/www/html --publish 8000:8000 laravel-7.4 ls -las
ls: ./.env: No such file or directory
ls: ./.env.example: No such file or directory
ls: ./artisan: No such file or directory
ls: ./artisan-orig: No such file or directory
ls: ./composer.json: No such file or directory
total 4
     0 drwxrwxrwx    1 root     root          8192 Apr 14 19:36 .
     4 drwxr-xr-x    3 root     root          4096 Mar 24 01:18 ..
     0 -rwxr-xr-x    1 root     root           220 Apr 14 19:01 .editorconfig
     0 -rwxr-xr-x    1 root     root           111 Apr 14 19:01 .gitattributes
     0 -rwxr-xr-x    1 root     root           163 Apr 14 19:01 .gitignore
     0 -rwxr-xr-x    1 root     root           174 Apr 14 19:01 .styleci.yml
     0 -rwxr-xr-x    1 root     root          4497 Apr 14 19:01 README.md
     0 drwxrwxrwx    1 root     root          4096 Apr 14 19:01 app
     0 drwxrwxrwx    1 root     root             0 Apr 14 19:01 bootstrap
     0 -rwxr-xr-x    1 root     root        200585 Apr 14 19:16 composer.lock
     0 drwxrwxrwx    1 root     root          4096 Apr 14 19:01 config
     0 drwxrwxrwx    1 root     root          4096 Apr 14 19:01 database
     0 -rwxr-xr-x    1 root     root          1013 Apr 14 19:01 package.json
     0 -rwxr-xr-x    1 root     root          1139 Apr 14 19:01 phpunit.xml
     0 drwxrwxrwx    1 root     root          4096 Apr 14 19:01 public
     0 drwxrwxrwx    1 root     root             0 Apr 14 19:01 resources
     0 drwxrwxrwx    1 root     root             0 Apr 14 19:01 routes
     0 -rwxr-xr-x    1 root     root           563 Apr 14 19:01 server.php
     0 drwxrwxrwx    1 root     root             0 Apr 14 19:01 storage
     0 drwxrwxrwx    1 root     root             0 Apr 14 19:01 tests
     0 drwxrwxrwx    1 root     root          8192 Apr 14 19:16 vendor
     0 -rwxr-xr-x    1 root     root           538 Apr 14 19:01 webpack.mix.js
PS C:\Users\jason>

Notice the "no such file or directory" errors. The entire laravel install was done from within the container on the mounted directory, and I can see all those files from the host directory.

[Discussion] Composer security issue

I propose change composer install from root to normal user as recommended by official composer https://getcomposer.org/doc/faqs/how-to-install-untrusted-packages-safely.md

From:

# Install composer ENV COMPOSER_HOME /composer ENV PATH ./vendor/bin:/composer/vendor/bin:$PATH ENV COMPOSER_ALLOW_SUPERUSER 1 RUN curl -s https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin/ --filename=composer

To:
# Install PHP Composer RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

The only impact would be PHPCS which is optional and include be included into composer.json

Link back to DockerHub

Small suggestion to have the README link to the DockerHub page, even though there's not much there. How about a badge like this?

Badge

[![Docker Badge](https://img.shields.io/docker/pulls/lorisleiva/laravel-docker)](https://hub.docker.com/r/lorisleiva/laravel-docker/)

Makes it easier to jump over there with a single click :)

Force rebuild for composer 2

Composer 2 was released a few weeks ago. I think your repository doesn't need any updates for this, but a rebuild of the images should be enough. Is this something that will happen soon? Thanks!

How to install OCI8 extension

I got the following error when running tests in Gitlab

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for yajra/laravel-oci8 v5.6.3 -> satisfiable by yajra/laravel-oci8[v5.6.3].
    - yajra/laravel-oci8 v5.6.3 requires ext-oci8 >=2.0.0 -> the requested PHP extension oci8 is missing from your system.

  To enable extensions, verify that they are enabled in your .ini files:
    - 
    - /usr/local/etc/php/conf.d/docker-php-ext-gd.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-imagick.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pcntl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Could you please tell me how to install "oci8 " ext. Thanks

Gitlab pipeline failed - iconv(): Wrong encoding

.gitlab-ci.yml


image: lorisleiva/laravel-docker:8.0

stages:
  - setup
  - test

prepare:
  stage: setup
  cache:
    key: "reports-application-$CI_COMMIT_BRANCH"
    paths:
      - .env
      - vendor
    policy: push
  script:
    - cp .env.example .env
    - composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
    - php artisan key:generate

unit_test:
  stage: test
  cache:
    key: "reports-application-$CI_COMMIT_BRANCH"
    paths:
      - .env
      - vendor
    policy: pull
  script:
    - vendor/bin/phpunit

On test stage, I'm getting following error ErrorException: iconv(): Wrong encoding, conversion from "ASCII" to "Windows-1252//TRANSLIT" is not allowed

Can anyone help me to resolve this issue ?

Best way for database connections

Hello,

What is the best way to link database connections using Laravel Deployer? At this time, it's only cloning the .env.example to .env and do not edit the DB credentials. If you can explain me the best way to do that safely ?

[Vote] SOAP extension

Hi, what do you think about including the soap extension for PHP?
It's often required when using external APIs.

Kind regards.

Composer Install Laravel 7.2 on Gitlab Pipeline Failed

Hi @lorisleiva, thanks for writing this helpful article https://lorisleiva.com/using-gitlabs-pipeline-with-laravel/. Here is my following setup:

  • composer.json
{
    "name": "wika-overseas-marketing/api-crm-wika-overseas",
    "type": "project",
    "description": "API CRM PT. Wijaya Karya (Persero) Tbk. Departemen Pemasaran Bangunan Gedung & Luar Negeri.",
    "keywords": [
        "laravel",
        "api",
        "crm"
    ],
    "license": "MIT",
    "require": {
        "php": ">=7.2",
        "ext-imagick": "*",
        "ext-json": "*",
        "barryvdh/laravel-snappy": "^0.4.8",
        "cloudcreativity/laravel-json-api": "^1.7.0",
        "fideloper/proxy": "^4.4.1",
        "intervention/image": "^2.5.1",
        "laravel/framework": "^6.20.7",
        "laravel/horizon": "^3.7.2",
        "laravel/slack-notification-channel": "^2.2.0",
        "laravel/tinker": "^1.0.10",
        "laravelcollective/errors": "^1.1.0",
        "lorisleiva/laravel-deployer": "^0.3.5",
        "maatwebsite/excel": "^3.1.26",
        "pusher/pusher-php-server": "^4.1.5",
        "sentry/sentry-laravel": "^1.9.0",
        "spatie/laravel-activitylog": "^3.16.1",
        "spatie/laravel-model-states": "^1.9.1",
        "spatie/laravel-permission": "^3.17.0",
        "tymon/jwt-auth": "^1.0.2",
        "yoelpc4/laravel-cloudinary": "^2.0.0",
        "yoelpc4/laravel-exchange-rate": "^3.0.0"
    },
    "require-dev": {
        "barryvdh/laravel-ide-helper": "^2.8.2",
        "beyondcode/laravel-dump-server": "^1.3.0",
        "cloudcreativity/json-api-testing": "^2.1.0",
        "facade/ignition": "^1.16.4",
        "fakerphp/faker": "^1.9.1",
        "laravel/ui": "^1.2.0",
        "mockery/mockery": "^1.3.3",
        "nunomaduro/collision": "^v3.0.1",
        "phpunit/phpunit": "^8.5.13|^9.3.11"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "files": [
            "helpers.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ],
        "post-install-cmd": [
            "php artisan clear-compiled",
            "chmod -R 775 public/"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "@php artisan clear-compiled",
            "@php artisan ide-helper:generate",
            "@php artisan ide-helper:meta",
            "@php artisan horizon:install"
        ]
    }
}
  • .gitlab-ci.yml
.set_git_credentials: &set_git_credentials |
  git config --global user.email "$GITLAB_USER_EMAIL"
  git config --global user.name "$GITLAB_USER_NAME"

.init_ssh: &init_ssh |
  eval $(ssh-agent -s)
  echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
  mkdir -p ~/.ssh
  chmod 700 ~/.ssh
  touch ~/.ssh/known_hosts
  echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
  chmod 644 ~/.ssh/known_hosts

.change_file_permissions: &change_file_permissions |
  find . -type f ! -path "./vendor/*" ! -path "./node_modules/*" -exec chmod 664 {} \;
  find . -type d ! -path "./vendor/*" ! -path "./node_modules/*" -exec chmod 775 {} \;

image: lorisleiva/laravel-docker:7.2

stages:
  - build
  - deploy

composer:
  stage: build

  only:
    - master
    - tags

  except:
    - develop

  cache:
    key: ${CI_COMMIT_REF_SLUG}-composer
    paths:
      - vendor/

  script:
    - composer install -o --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
    - cp .env.example .env
    - php artisan key:generate

  artifacts:
    expire_in: 1 month
    paths:
      - vendor/
      - .env

yarn:
  stage: build

  only:
    - master
    - tags

  except:
    - develop

  cache:
    key: ${CI_COMMIT_REF_SLUG}-yarn
    paths:
      - node_modules/

  script:
    - yarn install
    - yarn run prod

  artifacts:
    expire_in: 1 month
    paths:
      - node_modules/
      - public/css/
      - public/fonts/
      - public/js/

staging:
  stage: deploy

  environment:
    name: staging
    url: https://HEROKU_APP_NAME.herokuapp.com

  only:
    - master

  except:
    - tags

  script:
    - apk --update --no-cache add ruby ruby-dev ruby-irb ruby-rake ruby-io-console ruby-bigdecimal ruby-json ruby-bundler ruby-rdoc
    - gem install dpl
    - dpl --provider=heroku --app=$HEROKU_APP_NAME --api-key=$HEROKU_API_KEY
    - yarn global add heroku
    - heroku run php artisan migrate:fresh --drop-views --force --app $HEROKU_APP_NAME
    - heroku run php artisan db:seed --class=MasterDataSeeder --force --app $HEROKU_APP_NAME

production:
  stage: deploy

  environment:
    name: production
    url: https://$DIGITAL_OCEAN_APP_NAME

  only:
    - tags

  except:
    - branches

  script:
    - *set_git_credentials
    - *init_ssh
    - *change_file_permissions
    - php artisan deploy $DIGITAL_OCEAN_APP_NAME -v

Between January-November 2020, I faced no critical issue while implementing this package to execute CI/CD along with my laravel 7.2 project on the gitlab shared runner.

Currently I'm encountering a critical issue on my pipeline while the runner executing command composer install -o --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts.

This is the build log from gitlab shared runner

Running with gitlab-runner 13.7.0-rc1 (98e2e32d)
  on docker-auto-scale 0277ea0f
Preparing the "docker+machine" executor
00:35
Using Docker executor with image lorisleiva/laravel-docker:7.2 ...
Pulling docker image lorisleiva/laravel-docker:7.2 ...
Using docker image sha256:e289e99c3a485a8df8370088d3f5657ae88a92d45e431e920018b547a4c1f5c4 for lorisleiva/laravel-docker:7.2 with digest lorisleiva/laravel-docker@sha256:589a65741f745ea844479c12ad4232dd1dae10748a9a366d1b278aaa9d1caba5 ...
Preparing environment
00:01
Running on runner-0277ea0f-project-15543402-concurrent-0 via runner-0277ea0f-srm-1608416499-5ddcf709...
Getting source from Git repository
00:04
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/api-crm-wika-overseas/api-crm-wika-overseas/.git/
Created fresh repository.
Checking out 36233de2 as master...
Skipping Git submodules setup
Restoring cache
00:04
Checking cache for master-composer-6...
Downloading cache.zip from https://storage.googleapis.com/gitlab-com-runners-cache/project/15543402/master-composer-6 
Successfully extracted cache
Executing "step_script" stage of the job script
00:07
$ composer install -o --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Package operations: 0 installs, 49 updates, 0 removals
  - Downloading symfony/css-selector (v5.2.1)
  - Downloading symfony/var-dumper (v4.4.18)
  - Downloading symfony/routing (v4.4.18)
  - Downloading symfony/process (v4.4.18)
  - Downloading symfony/mime (v5.2.1)
  - Downloading symfony/http-foundation (v4.4.18)
  - Downloading symfony/event-dispatcher (v4.4.18)
  - Downloading symfony/debug (v4.4.18)
  - Downloading symfony/error-handler (v4.4.18)
  - Downloading symfony/http-kernel (v4.4.18)
  - Downloading symfony/finder (v4.4.18)
  - Downloading symfony/console (v4.4.18)
  - Downloading swiftmailer/swiftmailer (v6.2.4)
  - Downloading symfony/translation (v4.4.18)
  - Downloading nesbot/carbon (2.43.0)
  - Downloading monolog/monolog (2.2.0)
  - Downloading laravel/framework (v6.20.7)
  - Downloading symfony/filesystem (v5.2.1)
  - Downloading composer/spdx-licenses (1.5.5)
  - Downloading composer/composer (2.0.8)
  - Downloading barryvdh/laravel-ide-helper (v2.8.2)
  - Downloading sebastian/type (1.1.4)
  - Downloading sebastian/resource-operations (2.0.2)
  - Downloading sebastian/recursion-context (3.0.1)
  - Downloading sebastian/object-reflector (1.1.2)
  - Downloading sebastian/object-enumerator (3.0.4)
  - Downloading sebastian/global-state (3.0.1)
  - Downloading sebastian/exporter (3.1.3)
  - Downloading sebastian/environment (4.2.4)
  - Downloading sebastian/diff (3.0.3)
  - Downloading sebastian/comparator (3.0.3)
  - Downloading phpunit/php-timer (2.1.3)
  - Downloading phpunit/php-file-iterator (2.0.3)
  - Downloading sebastian/code-unit-reverse-lookup (1.0.2)
  - Downloading phpunit/php-token-stream (3.1.2)
  - Downloading phpunit/php-code-coverage (7.0.14)
  - Downloading phpspec/prophecy (1.12.2)
  - Downloading phar-io/version (3.0.4)
  - Downloading phar-io/manifest (2.0.1)
  - Downloading phpunit/phpunit (8.5.13)
  - Downloading fakerphp/faker (v1.13.0)
  - Downloading nikic/php-parser (v4.10.3)
  - Downloading symfony/yaml (v5.2.1)
  - Downloading paragonie/sodium_compat (v1.14.0)
  - Downloading pusher/pusher-php-server (v4.1.5)
  - Downloading symfony/options-resolver (v5.2.1)
  - Downloading symfony/http-client (v5.2.1)
  - Downloading sentry/sentry (2.5.1)
  - Downloading spatie/laravel-model-states (1.9.1)
  - Upgrading symfony/css-selector (v5.1.8 => v5.2.1): Extracting archive
  - Upgrading symfony/var-dumper (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading symfony/routing (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading symfony/process (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading symfony/mime (v5.1.8 => v5.2.1): Extracting archive
  - Upgrading symfony/http-foundation (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading symfony/event-dispatcher (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading symfony/debug (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading symfony/error-handler (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading symfony/http-kernel (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading symfony/finder (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading symfony/console (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading swiftmailer/swiftmailer (v6.2.3 => v6.2.4): Extracting archive
  - Upgrading symfony/translation (v4.4.16 => v4.4.18): Extracting archive
  - Upgrading nesbot/carbon (2.42.0 => 2.43.0): Extracting archive
  - Upgrading monolog/monolog (2.1.1 => 2.2.0): Extracting archive
  - Upgrading laravel/framework (v6.20.5 => v6.20.7): Extracting archive
  - Upgrading symfony/filesystem (v5.1.8 => v5.2.1): Extracting archive
  - Upgrading composer/spdx-licenses (1.5.4 => 1.5.5): Extracting archive
  - Upgrading composer/composer (2.0.7 => 2.0.8): Extracting archive
  - Upgrading barryvdh/laravel-ide-helper (v2.8.1 => v2.8.2): Extracting archive
  - Upgrading sebastian/type (1.1.3 => 1.1.4): Extracting archive
  - Upgrading sebastian/resource-operations (2.0.1 => 2.0.2): Extracting archive
  - Upgrading sebastian/recursion-context (3.0.0 => 3.0.1): Extracting archive
  - Upgrading sebastian/object-reflector (1.1.1 => 1.1.2): Extracting archive
  - Upgrading sebastian/object-enumerator (3.0.3 => 3.0.4): Extracting archive
  - Upgrading sebastian/global-state (3.0.0 => 3.0.1): Extracting archive
  - Upgrading sebastian/exporter (3.1.2 => 3.1.3): Extracting archive
  - Upgrading sebastian/environment (4.2.3 => 4.2.4): Extracting archive
  - Upgrading sebastian/diff (3.0.2 => 3.0.3): Extracting archive
  - Upgrading sebastian/comparator (3.0.2 => 3.0.3): Extracting archive
  - Upgrading phpunit/php-timer (2.1.2 => 2.1.3): Extracting archive
  - Upgrading phpunit/php-file-iterator (2.0.2 => 2.0.3): Extracting archive
  - Upgrading sebastian/code-unit-reverse-lookup (1.0.1 => 1.0.2): Extracting archive
  - Upgrading phpunit/php-token-stream (3.1.1 => 3.1.2): Extracting archive
  - Upgrading phpunit/php-code-coverage (7.0.12 => 7.0.14): Extracting archive
  - Upgrading phpspec/prophecy (1.12.1 => 1.12.2): Extracting archive
  - Upgrading phar-io/version (2.0.1 => 3.0.4): Extracting archive
  - Upgrading phar-io/manifest (1.0.3 => 2.0.1): Extracting archive
  - Upgrading phpunit/phpunit (8.5.11 => 8.5.13): Extracting archive
  - Upgrading fakerphp/faker (v1.12.0 => v1.13.0): Extracting archive
  - Upgrading nikic/php-parser (v4.10.2 => v4.10.3): Extracting archive
  - Upgrading symfony/yaml (v5.1.8 => v5.2.1): Extracting archive
  - Upgrading paragonie/sodium_compat (v1.13.0 => v1.14.0): Extracting archive
  - Upgrading pusher/pusher-php-server (v4.1.4 => v4.1.5): Extracting archive
  - Upgrading symfony/options-resolver (v5.1.8 => v5.2.1): Extracting archive
  - Upgrading symfony/http-client (v5.1.8 => v5.2.1): Extracting archive
  - Upgrading sentry/sentry (2.5.0 => 2.5.1): Extracting archive
  - Upgrading spatie/laravel-model-states (1.9.0 => 1.9.1): Extracting archive
    Update of symfony/css-selector failed
    Update of symfony/var-dumper failed
    Update of symfony/routing failed
    Update of symfony/process failed
    Update of symfony/mime failed
    Update of symfony/http-foundation failed
    Update of symfony/event-dispatcher failed
    Update of symfony/debug failed
    Update of symfony/error-handler failed
    Update of symfony/http-kernel failed
    Update of symfony/finder failed
    Update of symfony/console failed
    Update of symfony/translation failed
    Update of symfony/filesystem failed
    Update of composer/spdx-licenses failed
    Update of swiftmailer/swiftmailer failed
    Update of monolog/monolog failed
    Update of barryvdh/laravel-ide-helper failed
    Update of sebastian/type failed
    Update of sebastian/resource-operations failed
    Update of sebastian/recursion-context failed
    Update of sebastian/object-reflector failed
    Update of composer/composer failed
    Update of sebastian/object-enumerator failed
    Update of sebastian/global-state failed
    Update of sebastian/exporter failed
    Update of sebastian/environment failed
    Update of sebastian/diff failed
    Update of sebastian/comparator failed
    Update of phpunit/php-timer failed
    Update of nesbot/carbon failed
    Update of laravel/framework failed
    Update of phpunit/php-file-iterator failed
    Update of sebastian/code-unit-reverse-lookup failed
    Update of phpunit/php-token-stream failed
    Update of phpunit/php-code-coverage failed
    Update of phpspec/prophecy failed
    Update of phar-io/version failed
    Update of phar-io/manifest failed
    Update of phpunit/phpunit failed
    Update of symfony/yaml failed
    Update of pusher/pusher-php-server failed
    Update of symfony/options-resolver failed
    Update of symfony/http-client failed
    Update of sentry/sentry failed
    Update of spatie/laravel-model-states failed
    Update of nikic/php-parser failed
    Update of paragonie/sodium_compat failed
    Update of fakerphp/faker failed
In ClassLoader.php line 444:
                                                                               
  include(/builds/api-crm-wika-overseas/api-crm-wika-overseas/vendor/composer  
  /../composer/composer/src/Composer/Console/GithubActionError.php): failed t  
  o open stream: No such file or directory                                     
                                                                               
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-scripts] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
Cleaning up file based variables
00:00
ERROR: Job failed: exit code 1

As you can see this is the error thrown from composer

In ClassLoader.php line 444:
                                                                               
  include(/builds/api-crm-wika-overseas/api-crm-wika-overseas/vendor/composer  
  /../composer/composer/src/Composer/Console/GithubActionError.php): failed t  
  o open stream: No such file or directory

Do you have any idea how to solves this issue?

[Vote] FPM support

Is there a reason for opting for php:alpine over php:fpm-alpine or not offering the fpm variant as well?

It doesn't seem straight-forward to extend this image to add that fpm support looking at the Dockerfile for fpm variant(there's additional args run from an env var during the build).

Forking this repo just to replace the base image with the variant should work, but that doesn't seem like the right way to go about it.

Incompatibility with Laravel 8 schema_dump

Because this image is based on Alpine, when asked to install MySQL client it actually installs MariaDB's instead. This is often a reasonable substitution, but here it's fatal.

The problem is that Laravel 8's schema dump restore process (which makes CI pipelines run so much faster) builds a command line for the mysql CLI client and uses it to import the schema. MariaDB's CLI client is incompatible with MySQL 8.0 due to lack of support for its default auth mechanism, caching_sha2_password, so unless you also want to have to reconfigure your MySQL server (meaning you can't simply enable it using services: mysql:8.0 in your CI config) you have to disable schema dump and have your tests run slowly.

The command "mysql --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --database="${:LARAVEL_LOAD_DATABASE}" < "${:LARAVEL_LOAD_PATH}"" failed.
Exit Code: 1(General error)
Working directory: /builds/myapp
Output:
================
Error Output:
================
ERROR 1045 (28000): Plugin caching_sha2_password could not be loaded: /usr/lib/x86_64-linux-gnu/mariadb19/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

It's only the MaraDB client that's the problem. This is tricky to fix for Alpine Linux because it does not have a real MySQL package, even though MySQL includes support for Alpine.

I've been looking through various Laravel/PHP focused images for CI, and nearly all seem to suffer this problem, so I'm hoping one will fix it!

Add the xdebug extension back

In a commit comments, @ajcastro asked why xdebug was temporarly removed from this Docker image. I'm opening a new issue with my answer and the potential work that could be done to add it back.

Why was is removed?

The builds were failing due to the pecl extension xdebug. See related issue here.

Basically, the xdebug extension is still in RC phase for php 7.3.

However, after we've removed xdebug from the build, we also decided to support the latest 3 versions of php. So xdebug could be added back to 7.1 and 7.2.

We should hopefully be able to add it to 7.3 and latest very soon.

screenshot 2019-02-17 at 12 08 28

This raises potential issues when maintaining the latest image which is automatically update to the latest version of PHP since there will likely be a small gap in time where the latest version of PHP is ready but some of its extensions are not.

In summary

  • xdebug needs to be added back to the images 7.1 and 7.2.
  • xdebug needs to be added back to the images 7.3 and latest when xdebug is stable for 7.3.
  • Any ideas on how to manage the compatibility gap every time a new PHP version is released?

[Vote] Add XVFB for cypress tests

Hello, to avoid having to maintain my own image i was hoping you could add XVFB to this so that i could run my cypress tests with this image. If not i understand

Webserver addition

A webserver might be a nice addition (nginx or apache) as this way you can easily run your functional tests on the docker machine. I guess we can also use the builtin php webserver for this but just in case it has limitations a real server would be nice to have.

[Vote] Redis extension

Hi,

Thank you for great job.

Could you add mongodb and PHPREDIS extensions as well?

Cheers.

phpcs fails on latest version

phpcs --standard=PSR2 --extensions=php --ignore=".(blade.php)" app
/bin/bash: line 78: phpcs: command not found

I saw that codesniffer is now installed using composer, but changing the line to

./vendor/bin/phpcs --standard=PSR2 --extensions=php --ignore=".(blade.php)" app
/bin/bash: line 78: ./vendor/bin/phpcs: No such file or directory

did not fix the issue.

Is there something I'm missing?

Deploy not show '/bin/bash: line 94: /root/.: Is a directory' in .init_ssh

I already set variable at CI / CD Setting
image

My Config:

.init_ssh: &init_ssh |
eval $(ssh-agent -s)
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
mkdir -p ~/.ssh
chmod 700 ~/.ssh
[[ -f /.dockerenv ]] && echo -e "Host \n\tStrictHostKeyChecking no\n\n" > ~/.
.change_file_permissions: &change_file_permissions |
find . -type f -not -path "./vendor/
" -exec chmod 664 {} ;
find . -type d -not -path "./vendor/*" -exec chmod 775 {} ;
chmod 777 -R storage;

stages:

  • deploying

cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"

staging:
stage: deploying
image: lorisleiva/laravel-docker:latest

Pseudocode describing roughly what we're trying to achive

script:
- *init_ssh
- *change_file_permissions
- php artisan deploy 1.2.3.4 -s=upload

But i got this error. why it go to /root/. where can i find this code on?
image

[Vote] Support JPEG images

I have a test that simply calls File::image('this example.jpg') to perform an upload. However using this docker image I always get:

Error: Call to undefined function Illuminate\Http\Testing\imagejpeg()

I can see libpng-dev is installed

libpng-dev \

But libjpeg-dev isn't and also doesn't seem to exist for Alpine :/ anyone have any thoughts on this?

Permissions issues in recent deployments

I have recently upgraded several sites to Laravel 7 and deployed to servers running PHP 7.4 managed by Forge.

Each site ended up being unable to write to the storage and it's child directories until after I manually ran chown against them via ssh.

This was never an issue previously. Has there been some change that may cause this?

Enable normal caching of composer installs

In normal composer, caching is handled automatically and at least in terms of bitbucket pipelines (and probably other ci/cd infrastructure) they have pre-built caching that handles the lengthy install each time a build is performed.

Due to the setting in the docker image to change the composer home env, this breaks at least the bitbucket pipelines, but maybe more. Is there any reason to no just leave the composer home env alone and just let it work as intended? I see you have a configured custom cache in the gitlab deployment but it never mentions the actual composer cache, but only the vendor directory.

UDPATE: Simply removing the line in the dockerfile for setting the env, will enable the normal caching to work

Error on Gitlab CI Docker Daemon

I'm using your image with Gitlab and today I started getting this error

ERROR: Preparation failed: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (executor_docker.go:982:0s)

I tried both latest and stable and get the same thing.

Thanks for any help.

So if someone else suddenly sees this error and to Save them 8 hours. I ended up making sure Gitlab was fully updated. then I had to reboot the server and the issue went away.

Permission Error

Hello Here, I am stucked in my current set up.Here is the error when stage deploy is run
`In Client.php line 103:

The command "rm -f /opt/baso/portal/backend/mergedportal/.dep/deploy.lock" f
ailed.

Exit Code: -1 (Unknown error)

Host Name: portal-01.network.net

================
Permission denied, please try again.
Received disconnect from 100.xxxx port 22:2: Too many authentication
failures
Disconnected from 100.xxx port 22 `

in my Server I have a user as root and inside config/deploy.php I have this configuration

'hosts' => [ 'portal-01.network.net' => [ 'deploy_path' => '/opt/baso/portal/backend/mergedportal', 'user' => 'root', ], ],

Gitlab.ci

        staging:
           stage: deploy
           script:
              - "which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )"
              - eval $(ssh-agent -s)
              - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
              - mkdir -p ~/.ssh
              - chmod 700 ~/.ssh
              - ssh-keyscan portal-01.network.net >> ~/.ssh/known_hosts
              - chmod 644 ~/.ssh/known_hosts
              - php artisan deploy portal-01.network.net -s upload
        environment:
           name: staging
           url: portal-01.network.net
        only:
         - master

apcu and ldap extensions

I need to add apcu and ldap extensions in a gitlab pipeline. I have both ext-apcu and ext-ldap as dependencies in my composer.json.

In the before_script: section i tried:

apk --no-cache add php7-ldap php7-apcu

In the pipeline output both packages get installed but when composer install runs it fails and says that the extensions are not present. Are there any additional steps i need to do?

Sorry i'm a Debian/Ubuntu guy and don't have any knowledge about Alpine.

Thanks in advance.

Question about SSL_ERROR_SYSCALL

Hi,

When i run unit test which call external API, i got the following error
"LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to ......."

Even i use

CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYSTATUS => false,

Still not working.

$url = 'APIURL;
$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_RETURNTRANSFER => 1,
    CURLOPT_URL => $url,
    CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_SSL_VERIFYPEER => false,
    CURLOPT_SSL_VERIFYSTATUS => false,
]);

$resp = curl_exec($curl);

if (curl_errno($curl)) {
    dd(curl_error($curl));
}

curl_close($curl);

return json_decode($resp);

When i run test from my local/server it work, but when i run from laravel-docker it does not work, it throw that error

Could someone please help me. Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.