docksal / service-cli Goto Github PK
View Code? Open in Web Editor NEWCLI service image for Docksal
Home Page: https://docksal.io
License: MIT License
CLI service image for Docksal
Home Page: https://docksal.io
License: MIT License
docker@cli:/var/www/docroot$ php -v
PHP Deprecated: Comments starting with '#' are deprecated in /usr/local/etc/php/conf.d/zz-php.ini on line 11 in Unknown on line 0
PHP 5.6.33 (cli) (built: Jan 9 2018 02:59:27)
...
This is a regression introduced in d72dc5b
Hello,
Thank you for a great product.
Usually, I install the subj. so:
$ [sudo] npm install forever -g
I did it inside the cli
container.
But it does not see forever
:
docker@cli:/var/www$ forever
bash: forever: command not found
Yarn was present and could be started directly in v2.2.0
$ docker run -t -i --rm docksal/cli:2.2-php7.1 /bin/bash
docker@c9f1773a7687:/var/www$ yarn -v
1.7.0
docker@c9f1773a7687:/var/www$ which yarn
/usr/bin/yarn
But in 2.3.0 and 2.4.0 it is missing.
$ docker run -t -i --rm docksal/cli:2.3-php7.1 /bin/bash
docker@1903e2648ff0:/var/www$ yarn -v
bash: yarn: command not found
$ docker run -t -i --rm docksal/cli:2.4-php7.1 /bin/bash
docker@3fedf4f59cf5:/var/www$ yarn
bash: yarn: command not found
I think I found the problem. v2.2.0 installed yarn using a package (as described on yarnpkg.com) by adding a repository and installing the yarn
package. Starting from v2.3.0, yarn in installed using the install.sh
script downloaded from yarnpkg.com. This results in yarn being installed in a other location:
Version | location of yarn |
---|---|
2.2.0 | /usr/bin/yarn |
>= 2.3.0 | /home/docker/.yarn/bin/yarn |
Since /home/docker/.yarn/bin/
is missing from the $PATH
variable, the yarn executable could not be found.
After adding it the the $PATH
variable I got this message:
docker@cli:/var/www$ yarn
Yarn requires Node.js 4.0 or higher to be installed.
Yarn cannot find the node.js version installed in in /home/docker/.nvm/versions/node/
. After adding /home/docker/.nvm/versions/node/v8.11.3/bin
to $PATH
, yarn could be executed.
docker@cli:/var/www$ yarn -v
1.8.0
Edit: The commit where the change from package to install script was made is 82a8258
Please create PHP 7.1 and 7.2 images. Some Drupal 8 projects requires at least 7.1.
Thank you
Best regards
I would like to see PHP Compatibility check for PHP_CodeSniffer integrated in service-cli container.
https://github.com/wimg/PHPCompatibility
It is useful to validate the code compatibility with PHP7.x on old projects which worked on PHP5.x before.
Since #56 is implemented we need to update documentation and fin
to use cli:php7.1
Composer often uses lots of memory and crashes with the default limit.
I'm not sure why it happens but sometimes after fin rm
and fun up
cli
gets created in a weird manner and npm
complains about that file. (docksal/cli:1.2-php7
)
Creating this issue to track this behavior and possible issue. Output is below. You might notice that owner of some files is not docker but 501. Which is weird, because docker user should have had id equal to 501 after "Changing uid/gid in cli to 501/20 to match the host". But it did not. That explains the nature of the error, but does not explain how did we get here.
08:34:35 Alexei-Workstation /Users/alexei.chekulaev/Projects/demo
$ fin rm -f
Removing containers...
Stopping demo_web_1 ... done
Stopping demo_cli_1 ... done
Stopping demo_mail_1 ... done
Stopping demo_db_1 ... done
Removing demo_web_1 ... done
Removing demo_cli_1 ... done
Removing demo_mail_1 ... done
Removing demo_db_1 ... done
Removing network demo_default
Removing volume demo_project_root
Volume docksal_ssh_agent is external, skipping
Removing volume demo_host_home
08:35:05 Alexei-Workstation /Users/alexei.chekulaev/Projects/demo
$ fin up
Starting services...
Creating network "demo_default" with the default driver
Creating volume "demo_project_root" with local driver
Creating volume "demo_host_home" with local driver
Creating demo_mail_1
Creating demo_cli_1
Creating demo_db_1
Creating demo_web_1
Changing uid/gid in cli to 501/20 to match the host
Resetting permissions on /var/www...
chown: changing ownership of ‘/var/www/node_modules/.bin/esparse’: Input/output error
chown: changing ownership of ‘/var/www/node_modules/.bin/esvalidate’: Input/output error
chown: changing ownership of ‘/var/www/node_modules/.bin/js-yaml’: Input/output error
chown: changing ownership of ‘/var/www/vendor/bin/php-parse’: Input/output error
chown: changing ownership of ‘/var/www/vendor/bin/psysh’: Input/output error
chown: changing ownership of ‘/var/www/vendor/bin/robo’: Input/output error
chown: changing ownership of ‘/var/www/vendor/bin/terminus’: Input/output error
Restarting php daemon...
Connected vhost-proxy to "demo_default" network.
08:35:26 Alexei-Workstation /Users/alexei.chekulaev/Projects/demo
$ fin run ls -la /home/docker
┌──────────────────────────────────────────────────────────┐
│ npm update check failed │
│ Try running with sudo or get access │
│ to the local update config store via │
│ sudo chown -R $USER:$(id -gn $USER) /home/docker/.config │
└──────────────────────────────────────────────────────────┘
total 64
drwxr-xr-x 24 501 100 4096 May 4 12:35 .
drwxr-xr-x 12 root root 4096 May 4 12:35 ..
drwxr-xr-x 2 docker 100 4096 May 4 12:35 .acquia
-rw-r--r-- 1 docker 100 140 Apr 7 17:41 .bash_aliases
-rw-r--r-- 1 501 100 220 Nov 5 21:22 .bash_logout
-rw-r--r-- 1 501 100 3618 Apr 7 17:39 .bashrc
drwxr-xr-x 6 docker 100 4096 May 4 12:35 .composer
-rw-r--r-- 1 docker 100 377 Apr 7 17:29 .docksalrc
drwxr-xr-x 7 docker 100 4096 May 4 12:35 .drush
drwxr-xr-x 340 docker 100 4096 May 4 12:35 .npm
drwxr-xr-x 14 501 100 4096 May 4 12:35 .nvm
-rw-r--r-- 1 docker 100 716 Apr 7 17:41 .profile
drwxr-xr-x 2 docker 100 4096 May 4 12:35 .ssh
lrwxrwxrwx 1 501 100 36 Apr 7 17:38 .zlogin -> /home/docker/.zprezto/runcoms/zlogin
lrwxrwxrwx 1 501 100 37 Apr 7 17:38 .zlogout -> /home/docker/.zprezto/runcoms/zlogout
drwxr-xr-x 10 docker 100 4096 May 4 12:35 .zprezto
lrwxrwxrwx 1 501 100 39 Apr 7 17:38 .zpreztorc -> /home/docker/.zprezto/runcoms/zpreztorc
lrwxrwxrwx 1 501 100 38 Apr 7 17:38 .zprofile -> /home/docker/.zprezto/runcoms/zprofile
lrwxrwxrwx 1 501 100 36 Apr 7 17:38 .zshenv -> /home/docker/.zprezto/runcoms/zshenv
lrwxrwxrwx 1 501 100 35 Apr 7 17:38 .zshrc -> /home/docker/.zprezto/runcoms/zshrc
drwxr-xr-x 4 docker 100 4096 May 4 12:35 drush6
drwxr-xr-x 4 docker 100 4096 May 4 12:35 drush7
Notice: no .config
dir at all!
After I got to this situation I got confused, so I did fin rm
and fin up
once again. And it just went back to normal.
08:37:03 Alexei-Workstation /Users/alexei.chekulaev/Projects/demo
$ fin rm
WARNING: All containers and volumes for the current project will be removed!
Continue? [y/n]: y
Removing containers...
Stopping demo_web_1 ... done
Stopping demo_db_1 ... done
Stopping demo_cli_1 ... done
Stopping demo_mail_1 ... done
Removing demo_web_1 ... done
Removing demo_db_1 ... done
Removing demo_cli_1 ... done
Removing demo_mail_1 ... done
Removing network demo_default
Removing volume demo_project_root
Volume docksal_ssh_agent is external, skipping
Removing volume demo_host_home
08:37:23 Alexei-Workstation /Users/alexei.chekulaev/Projects/demo
$ fin up
Starting services...
Creating network "demo_default" with the default driver
Creating volume "demo_project_root" with local driver
Creating volume "demo_host_home" with local driver
Creating demo_cli_1
Creating demo_mail_1
Creating demo_db_1
Creating demo_web_1
Changing uid/gid in cli to 501/20 to match the host
Resetting permissions on /var/www...
chown: changing ownership of ‘/var/www/node_modules/.bin/esparse’: Input/output error
chown: changing ownership of ‘/var/www/node_modules/.bin/esvalidate’: Input/output error
chown: changing ownership of ‘/var/www/node_modules/.bin/js-yaml’: Input/output error
chown: changing ownership of ‘/var/www/vendor/bin/php-parse’: Input/output error
chown: changing ownership of ‘/var/www/vendor/bin/psysh’: Input/output error
chown: changing ownership of ‘/var/www/vendor/bin/robo’: Input/output error
chown: changing ownership of ‘/var/www/vendor/bin/terminus’: Input/output error
Restarting php daemon...
Connected vhost-proxy to "demo_default" network.
08:37:45 Alexei-Workstation /Users/alexei.chekulaev/Projects/demo
$ fin exec ls
222 app.js composer.json composer.lock docker-compose.yml docroot installer.phar node_modules vendor
With the current build/release process release tags are built separately (when a tag is published) from the master branch.
docksal/cli:<image-version>-php<php-version> != docksal/cli:php<php-version>
They should match.
This can be achieved by building tags from the latest stable versions instead if from scratch:
FROM docksal/cli:php<php-version>
Reference issue: docksal/docksal#507
Make it possible to install additional Ruby versions and switch between them via rvm
Since Acquia and Pantheon (not sure about Platform.sh) have APCu installed, we should have it too.
Originally reported in docksal/docksal#729 (comment)
I would like to see Lastpass CLI integrated in service-cli container or even better - in separate standalone container independent from project.
https://github.com/lastpass/lastpass-cli
And ideally lastpass default config should be the following:
# let LPass passwords be read from standard input.
LPASS_DISABLE_PINENTRY=1
# Keep user signed in in LPass cli while container is running.
LPASS_AGENT_TIMEOUT=0
FROM docksal/cli:2.2-php7.1
RUN apt-get update && apt-get -y --no-install-recommends install openssl \
libcurl4-openssl-dev libxml2 libssl1.0-dev libxml2-dev pinentry-curses xclip \
cmake build-essential pkg-config gcc libyaml-dev; \
printf "\n" | pecl install yaml-2.0.2; \
docker-php-ext-enable yaml; \
rm lastpass-cli-1.3.1/ -rf; \
wget -qO- https://github.com/lastpass/lastpass-cli/archive/v1.3.1.tar.gz | tar zxf -; \
cd lastpass-cli-1.3.1; \
make; \
make install; \
cd ..;\
rm lastpass-cli-1.3.1/ -rf; \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
FROM docksal/cli:1.3-php5
# Install Necessary libs.
RUN apt-get update; \
apt-get -y --no-install-recommends install \
libcurl4-openssl-dev \
libxml2 \
libssl-dev \
libxml2-dev \
pinentry-curses \
xclip \
cmake \
pkg-config \
php5-dev \
libyaml-dev; \
printf "\n" | pecl install yaml-1.3.1; \
echo 'extension=yaml.so' | tee -a /etc/php5/mods-available/yaml.ini > /dev/null; \
php5enmod yaml; \
rm lastpass-cli-1.3.1/ -rf; \
wget -qO- https://github.com/lastpass/lastpass-cli/archive/v1.3.1.tar.gz | tar zxf -; \
cd lastpass-cli-1.3.1; \
make; \
make install; \
cd ..;\
rm lastpass-cli-1.3.1/ -rf; \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Detailed instructions: https://github.com/lastpass/lastpass-cli#debianubuntu
Make it possible to install additional Python versions and switch between them via pyenv.
Drush 8.1.11 has issues with Drupal 8.4.
Update Drush to 8.1.13.
See this issue:
https://www.drupal.org/node/2874827
image: docksal/cli:2.4-php7.1
17:27:53 ~/Projects/test
§ fin exec nvm --version
0.33.11
17:28:00 ~/Projects/test
§ fin bash
docker@cli:/var/www$ nvm --version
bash: nvm: command not found
docker@cli:/var/www$
Drupal CLI no longer works as part of the global aspect and therefore fails every time it runs.
Since PHP 7.3.0 is now released, an image with support for PHP 7.3 should now also be built.
; Mail settings
sendmail_path = '/usr/local/bin/mhsendmail --smtp-addr=mail:1025'
Parent issue: docksal/docksal#776
Currently right now the port is hardcoded for 3000 allow for this to be customized with an environment.
Hi,
I am sure someone has done this before.
How would I add php7.1-gmp extention to cli ?
I tried searching using apt-cache searc php-gmp but nothing came up.
Regards,
Amjad
Make Acquia BLT run with Docksal.
SECRET_SSH_PRIVATE_KEY
SECRET_ACAPI_EMAIL
and SECRET_ACAPI_KEY
SECRET_TERMINUS_TOKEN
Parent issue: docksal/docksal#488
Drupal commerce for D8 has a dependency on bcmath. I was able to resolve with:
sudo apt-get update
sudo apt-get install php7.0-bcmath
Can we get bcmath included in the Dockerfile?
MSSQL support via mssql
and pdo_dblib
PHP extensions for PHP 5.6.
Add ability to have custom shell script, that would live in .docksal/services/cli/startup.sh
, and that cli
would automatically discover and run after its startup.
Copy of docksal/docksal#484 in this repo
Was just on dockerhub and need to update our latest and non version tags to use the latest and greatest set of code.
https://hub.docker.com/r/docksal/cli/tags/
Originally reported in docksal/docksal#587
In the edge versions on docksal/cli
nvm was removed and replaces with a global nodejs installation.
We should add nvm
back, but without the default node version. This way, if someone needs a non-default (global) nodejs version, they can install it with nvm
.
Add in WordPress coding standards into the CLI container
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards
Empty SECRET_SSH_PRIVATE_KEY generates an empty id_rsa file and is causing issues with SSH authentication, I assume id_rsa is first key SSH will try to use, see command below for proof.
I believe the issue is present since 2.1 version of Docksal when this private key variable was introduced
Empty key:
fin exec cat /home/docker/.ssh/id_rsa
Trying to SSH somewhere will try to use that key and ask for a passphrase (not sure why):
fin exec ssh -vvv example.com
.............
debug1: Trying private key: /home/docker/.ssh/id_rsa
Enter passphrase for key '/home/docker/.ssh/id_rsa':
I am using the docksal/cli:edge-php7.1 image, which set default max_memory = 256MB for FPM. According to the docksal documentation, i should be able to override setting by placing a php.ini file in .docksal/etc/php/php.ini; this is not working anymore, even after i run 'fin reset'.
Currently one must be in the Drupal Webroot to use Drush. With projects moving to Drush 9 which is only supported installed per project adding the Drush Launcher makes sense.
Adding the Drush Launcher would allow running drush commands anywhere in a composer managed project and would automatically use the version of Drush installed in the project.
To allow Drush Launcher to fallback for projects that do not have Drush as part of the project (Drupal 7) the environmental variable DRUSH_LAUNCHER_FALLBACK
should be set to the path to the globally installed Drush 8. The path to the Drush Launcher should be added to the $PATH so that it comes before any other drush
command files.
See the command in this Drush Launcher issue for a command that will install the most recent version without having to update it each time a new version comes out.
Raised in docksal/docksal#427 (comment)
Using latest image is not always the best way to go, since an image can have a major version update with incompatible changes.
But using static tag (1.3
, 2.2
...) is not the best way either, since configuration goes stale over time and then people who pick up an old project will have to refresh it to even start an old project on the new version of fin
.
Using 1.x
or 2.x
tags, what should point to the latest minor version of the 1.x, 2.x etc. branch, would make more sense, since it is unlikely to break compatibility with your automation and configuration, but at the same time will keep one updated to the latest version of the image which will have the highest chances of being compatible with the latest Docksal.
In some corporate networks people need SSL to access external resources.
docksal/docksal#625
MSSQL server driver for PHP
https://github.com/Microsoft/msphpsql
Instructions for Ubuntu/Debian (also available in the repo)
https://www.microsoft.com/en-us/sql-server/developer-get-started/php/ubuntu/step/2.html
Support on Linux is available for PHP 7.0+ only.
Add Integration with APM for PHP
Examples:
https://github.com/patrickallaert/php-apm
https://github.com/patrickallaert/php-apm-web
https://tideways.com/profiler/xhprof-for-php7
I am looking for a way to add an extension for edge-php7.2. Not sure if there's a way to do it via the etc/php/php-fpm.conf file.
If that is not doable, is that mean i have to create a new image with the extension for now? I am thinking there may be a way to dynamically add extension in the current image.
Thanks.
Installing extension is not trivial now so we should enable those often used ones.
stack-node:
stack-default-nodb:
I'm new to docker and docksal so maybe there is a very simple answer I didn't find yet:
Is there a way to configure additional php modules? For example I'm adding a redis container to my setup and would need php7.0-redis to be installied in the cli container. How would I do that?
Install Pantheon's terminus
into cli
service by default. Relates to docksal/docksal#485
Composer Prestissimo plugin allows faster parallel installs of packages and is highly adopted in the
community, I propose we add it to docksal CLI image.
Example: https://github.com/wodby/php/blob/master/7.0/Dockerfile#L197
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.