André Amorim

Crafting Web Experiences

//

docker

Go back to /notes?

  • Docker Images Security Check

    Built-in method: SCA Tool:Trivy – https://trivy.dev

  • Docker resource usage

  • See the Docker logs in terminal

    For Docker Compose This will show logs in all services defined in docker-compose.yml file: If you want it to watch all the new logs interactively, use the –follow flag: You might want to see only last 100 records in the screen: You can also see the logs only for specific services in docker-compose.yml: Any Docker…

  • Running a WordPress site with WP-ENV

    You need to install WP-ENV globally or project based first. Then, create a “.wp-env.json” file to the root folder which has “wp-content” folder in it. .wp-env.json: (Most optimized config, here for details) To Run Server: (might take long at first) To Import Existing DB: To Export DB: Rewrite Flush: (Not working. Enter Settings > Permalinks…

  • Filter Docker containers and list with specific information

    The default running container listing command: List all containers either running and stopped: Choose specific information for the table that will be listed. I only wanted to list container names and their statuses: And finally, filter them by container names. I’m filtering the containers which contain “_wp” word: Reference: https://docs.docker.com/engine/reference/commandline/container_ls/

  • DB Search & Replace on Docker WP with WP-CLI

    If you use WP-CLI as a separate container as usual, use this command to do a search replace without going into the container: With less options:

  • Installing NGINX in a PHP/WordPress container

    Dockerfile: NGINX default.conf:

  • Get into a Docker Container’s Shell

    If you’re using Docker Composer in your project: Or, if you want to get into any kind of container: According to your system needs, you might need to add “-it” flag after “exec” parameter. Reference URLs:1. https://docs.docker.com/engine/reference/commandline/compose_exec/2. https://docs.docker.com/engine/reference/commandline/exec/