docker-compose upThey have removed links from version 2 onwards, added feature depends_on Looking at networks: how easy and innovative way Container share the underlying OS kernel and as a result we cannot have a windows container running on linux host or vice versa.
|
|
|
|
|
|
Tip #1: Order matters for cachingTip #2: More specific COPY to limit cache bustsTip #3: Identify cacheable units such as apt-get update & installReduce Image sizeImage size can be important because smaller images equal faster deployments and a smaller attack surface. Tip #4: Remove unnecessary dependencies. Tip #5: Remove package manager cacheMaintainabilityTip #6: Use official images when possibleTip #7: Use more specific tagsTip #8: Look for minimal flavorsReproducibilityTip #9: Build from source in a consistent environmentThe source code is the source of truth from which you want to build a Docker image. The Dockerfile is simply the blueprint. Tip #10: Fetch dependencies in a separate step.Tip #11: Use multi-stage builds to remove build dependencies (recommended Dockerfile)
|
|
docker run --name alpine-2 --network=none alpine docker network create --driver bridge --subnet 182.18.0.1/24 --gateway 182.18.0.1 wp-mysql-network docker run -d --name mysql-db --network wp-mysql-network -e MYSQL_ROOT_PASSWORD=db_pass123 mysql:5.6 docker run --network=wp-mysql-network -e DB_Host=mysql-db -e DB_Password=db_pass123 -p 38080:8080 --name webapp --link mysql-db:mysql-db -d kodekloud/simple-webapp-mysql docker run --network=wp-mysql-network -e DB_Host=mysql-db -e DB_Password=db_pass123 -p 38080:8080 --name webapp --link mysql-db:mysql-db -d kodekloud/simple-webapp-mysql
|