- Category: Development
- A Docker image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. Available for both Linux and Windows based apps, containerized software will always run the same, regardless of the environment. Containers isolate software from its surroundings, for example differences between development and staging environments and help reduce conflicts between teams running different software on the same infrastructure.
- A container is a runtime instance of an image—what the image becomes in memory when actually executed. It runs completely isolated from the host environment by default, only accessing host files and ports if configured to do so. Container are stateless and should be considered read only! (you can go inside the container change data, but at container creation your changes are lost)
- Both MYSQL (Data, users) and Wordpress (plugins, themes, uploads) are stateful, so we have to use Docker volume to persist data across container restart.
- expose: 3306 will let you connect later with MySQLWorbench to the port from outside of the container. it is optional.
- depends_on tell wordpress to wait till mysql db container is up
- The always restart policy tells Docker to restart the container under every circumstance. What’s great about the always restart policy is that even if our Docker host was to crash on boot, the Docker service will restart our container.
Create a new file docker-compose.yml, adapt values to your liking, especially all passwords and username. Note that MYSQL and Worpress data are persisted OUTSIDE of container.
file_uploads = On memory_limit = 256M upload_max_filesize = 256M post_max_size = 300M max_execution_time = 600
version: '2' services: wordpress: depends_on: - db image: wordpress:latest volumes: - ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini - ./file-wordpress:/var/www/html ports: - 80:80 - 443:443 restart: always environment: WORDPRESS_DB_HOST: db WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: wordpress WORDPRESS_TABLE_PREFIX: abcd db: image: mysql:5.7 volumes: - ./db-wordpress:/var/lib/mysql restart: always expose: - "3306" environment: MYSQL_ROOT_PASSWORD: wordpress MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: wordpress
The docker-compose up command aggregates the output of each container. It Builds, (re)creates, starts, and attaches to containers for a service. When the command exits, all containers are stopped. Running docker-compose up -d starts the containers in the background and leaves them running. To start Wordpress in the background
To find the name of the container
docker-compose up -d
docker ps -a
To read the logs file
To go inside the container (remember all changes in there are lost at container restart)
docker logs wordpress docker logs db
To delete all volume
docker exec -it wordpress bash
docker-compose rm -v
- Category: Hobbies
Life is more fun with LEGO!!!!
- You have a script that uses REST call to pull down the LATEST maven artifacts every night from Nexus and deploys them.
- You make extensive use of the REST API in all your puppet modules
- You use the Atlassian Puppet module for Nexus for creating repository, groups, assigning repository to groups, updating the main config settings, things like proxy, email, realms, and so on. The Puppet module is simply a wrapper over the Nexus REST API and allows to essentially import those abstractions into Puppet Config Management
When working with many feature/release/bugix/hotfix branches, it is a bad idea to start changing the pom version as this will create merge conflicts using pull request. this plugin allow you to keep in ALL branches the same pom version for all your projects, for example MASTER-SNAPSHOT the version will be derived from branch name automagically :-)
You may want to read more first these 2 short articles
git-branch-renamer-maven-plugin allow you to keep in ALL branches the same pom version for all your projects: for example
MASTER-SNAPSHOT and never change it again.
the project version will be derived from branch name automatically when running in your continuous integration server.
<version>xxxx</version>(release = true)
<version>0-xxxx-SNAPSHOT</version>(forceNumericalVersion = true)
<version>feature-xxxx-SNAPSHOT</version>(filterOutBranchQualifier = false)
The project is hosted at Github https://github.com/cedricwalter/git-branch-renamer-maven-plugin