Docker – remove orphaned volumes

docker volume rm $(docker volume ls -qf dangling=true)

JSON parsing from the command-line

You don’t need to use Python for basic JSON parsing, just use `jq`:

jq – Command-line JSON processor

see:

  • https://stedolan.github.io/jq/manual/
  • http://support.gnip.com/articles/data-and-rule-management-with-jq.html
  • etc.

    SSH bypass host checking for dev Docker environment

    If you have a controlled environment where you are recreating SSH target instances, such as Docker containers, and have integration scripts (e.g., Jenkins), you will often run into SSH warnings that will prevent the CI/CD jobs from completing.

    If you are sure the target is in a controlled environment – e.g., within a Docker host/network, you can bypass the checks via:

    ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no

    You could also update the UserKnownHostsFile but it can be tricky. There probably is a better setup than relying on SSH, but as we transition legacy workflow this works for now.

    Recreate single Docker container using docker-compose

    Often you want to restart a container that you started using docker-compose and have it recreate the container due to some config change. If you pull a new image, it will usually recreate the container but simply updating the compose file will not.

    Using `up` with `–no-deps` should do the trick for a stopped container. (Note example below uses background process `-d` arg.(

    docker-compose stop service
    {docker-compose build/pull/edit config/etc} service
    docker-compose up -d --no-deps service

    PHP Composer.lock Git conflicts

    If you get a git conflict on composer.lock, ignore local changes and fetch the latest from Git. Then run a composer update and commit the updated lockfile to make sure it includes everything.

    [credit]

    Consumer-Driven Contracts: links

    I like the idea of CDC, certainly easier to aspire to than to implement, would be interested to hear actual success stories.

    Also the examples showing 1-to-1 matching criteria seem to against the intention of “not caring exactly what the data is, as long as it satifies my needs”.

    Consumer-Driven Contracts: A Service Evolution Pattern

    https://martinfowler.com/articles/consumerDrivenContracts.html

    https://docs.pact.io/

    https://github.com/pact-foundation/pact-js

    https://docs.pact.io/documentation/matching.html

    Also seems like a server-side validator like Joi could be pretty useful for this purpose:

    http://vawks.com/blog/2014/03/22/the-joi-of-validation/

    « Previous Entries