docker tips

MonogDB Check script on start

#!/bin/sh

dsn=mongodb://127.0.0.1:27018

#while [ true ]; do mongo $dsn --eval 'quit();'; echo "$?"; if [ "$?" == "0" ]; then exit; fi; sleep 1; done;

while [ true ]; do
  mongo $dsn --eval 'quit();';
  echo "$?";
  if [ "$?" == "0" ]; then
    exit;
  fi;
  sleep 1;
done;

XDebug

;PHPStorm
[xdebug]
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_mode = req
xdebug.remote_host = 10.254.254.253
xdebug.remote_port = 9000
xdebug.remote_autostart = on
xdebug.remote_connect_back = off
On MacOS
$ sudo ifconfig lo0 alias 10.254.254.253
On Linux
$ sudo ifconfig lo:0 10.254.254.253 netmask 255.255.255.0 up
CLI
$ export PHP_IDE_CONFIG="serverName=localhost"

github.com

Docker pull (update) all images
#!/usr/bin/env bash

docker images | grep -v REPOSITORY | awk '{print $1}' | grep -v '<none>' | xargs -L1 docker pull