Posts

Showing posts with the label cheat sheet

THE ULTIMATE DOCKER CHEAT SHEET

  1. RUN a CONTAINER (I) Start new container from an image:  docker run IMAGE_NAME (II) And assign it a name:  docker run --name CONTAINER _NAME IMAGE_NAME (III) To map a port:  docker run -p HOST_PORT:CONTAINER_PORT IMAGE (IV) To MAP all port:  docker run -P IMAGE_NAME (V) And Start a Container in background:  docker run -d IMAGE_NAME (VI) And Assign it a HOST NAME:  docker run --hostname HOSTNAME IMAGE_NAME (VII) And add a DNS entry or HOST entry in /etc/hosts file:  docker run  --add-host  HOSTNAME:IP IMAGE (VIII) And map a local directory (volume) to a container:  docker run -v HOST_DIR:TARGET_DIR IMAGE_NAME (IX)   ALL IN ONE Example :  docker run --name my_container -p 80:80 -v /home/data/:/var/www/html/--add-host test.ac.in:10.246.10.6 --hostname nginx_host -d nginx 2. MANAGE CONTAINERS (I) Show List of all running containers :  docker ps (II) Show List of all running and stop containers :  docker p...

ADVANCED DOCKER COMMAND CHEAT SHEET

  Remove all images : docker rmi $(docker images -q) Remove all running containers: docker rm -f $(docker ps -q) Remove all Containers: docker rm -f $(dcoker ps -aq) Remove all dangling (unused) container and images: docker system prune -a Create volume : docker volume create List volume: docker volume ls Remove Volume: docker volume rm Inspect Volume: docker volume inspect Remove Stop Containers: docker rm $(docker ps -q -f “status=exited”) Push an image to a registry: docker push [registry]/[username]/<image-name>:[tag] Run a detached container in a previously created container network: $ docker network create mynetwork & $ docker run — name mywildfly-net -d — net mynetwork \ -p 8080:8080 jboss/wildfly Push an image to a registry: docker push [registry]/[username]/<image-name>:[tag] Build Image with diffrent dockerfile name: docker build -t test -f DockerfileTest .

Drush Ultimate Basic Cheat Sheet

  Setup Drush: Download drush from  https://git.drupalcode.org/project/drush.git Make the ‘drush’ command executable:  $ chmod u+x /path/to/drush/drush create a symbolic link to the Drush executable in a directory that is already in your PATH, e.g.:  $ ln -s /path/to/drush/drush /usr/bin/drush Run Following Commands. drush pmi <module-name> :  Display primary info of drupal modules drush dl <module-name>  : Download Particular drupal module drush en <module-name>  : Enable/Install drupal module drush dis <module-name>  : Disable drupal module drush uninstall <module-name>  : Uninstall drupal module (Delete data from database so cross check module name before run this command) drush upwd --password=”newpassword" “drupal-user”  : Change drupal user password with drush command drush watchdog-show --tail  : To view drupal logs on terminal Enjoy