![]() Type '\c' to clear the current input statement. Server version: 10.1.16-MariaDB-1~jessie binary distributionĬopyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others. MYSQL_PASSWORD=your_database_password (Scroll down.) $ docker-compose kill & docker-compose up -d Private network automatically created per setĬontainers preconfigured with the right port open version: '2' MYSQL_PASSWORD=your_database_password (Scroll down.) Wait, no port? VAR_NAME= VALUE What vars to use?Ĭheck Hub page for variable names and use version: '2' Use environment variables Setting variables Use absolute paths in the container Kill, up, refresh. path/on/host: path/in/container Our project so far /home/tess/projects/rideTheWhale Mounts a directory or file in the container Volumes in Compose $ docker-compose up -d Getting files in the container VolumesĬreates a persistent directory inside a container Image: mariadb Updating containers $ docker-compose kill " portOnHost: portInContainer" version: '2' Needed to access the container from the host Ridethewhale_web_1 apache2-foreground Up 80/tcp Compose and container names parentDirName_ serviceName_ index Use unique project names! /home/tess/projects/rideTheWhale Ridethewhale_db_1 docker-entrypoint.sh mysqld Exit 1 Image: mariadb Starting container sets docker-compose up -dĭocker-compose.yml must be in current directory! Listing container sets $ docker-compose ps Save in the root directory of your project! A basic LAMP set version: '2' Not exactly true, but close LAMP needs multiple processes Think "process" Using a detached container docker exec container_id /command/to/run Using exec $ docker exec -i -t b4d exit to quit Stopping containers by ID docker kill container_id Building a web stack "A container is just a process" Use the first few characters as a shorthand Listing containers docker ps Unique identifier for that container instance Use exit to quit Run in the background $ docker run -d debian /bin/bash -c "while true do sleep 1 done"ī4d333ad4d0f9c68249a091fdde53d25a09cbc785c5aba2a697b3a3ea04da778 Unique per container, check page on Hub Using containers Running a container docker run image_name $ docker run -i -t debian uname -a Used for different versions or varients Tags are optional Good "base image" for web projects Container tags image_name: tag Image_name is the name on Docker Hub Pulling Debian $ docker pull debian Downloading Containers docker pull image_name Online repository of ready-to-use containers Official ContainersĪpache, PHP, MySQL, and many Linux Distros Official Drupal Container /_/drupal Use your distro's package manager to install Getting containers Docker is like Vagrant Virtualbox for earlier versions Docker on Linux should apply to servers too Docker is sharableĪdd build files to your repo Getting Docker Do I need to pay for it?ĭocker is free and open source! /docker/docker Docker for Mac and Win /products/dockerĭocker 1.12+ Older Systems? /products/docker-toolbox On-boarding, troubleshooting, and recovery time The DRY principle. That's what bespoke environments are Adds hidden costs Humans are fallible, forgettable, fried No Special Snowflakesīuilt from a few simple text files Problem #3ĭev environment isn't sharable You can't share No matter the project or tech stack Problem #2ĭev environment isn't repeatable Instructions aren't enough Takes time, disipline to find and remove Docker sandboxes everything stays on your system forever Like pulling weeds No sandboxing What happens outside the repo. ![]() rideTheWhale "What's wrong with MAMP?" Problem #1
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |