How do I check if my local docker image is outdated, without pushing from somewhere else?

You can query the registry API for the image digest and compare it to that of what you’ve pulled. $ cat digest-v2.sh #!/bin/sh ref=”${1:-library/ubuntu:latest}” repo=”${ref%:*}” tag=”${ref##*:}” acceptM=”application/vnd.docker.distribution.manifest.v2+json” acceptML=”application/vnd.docker.distribution.manifest.list.v2+json” token=$(curl -s “https://auth.docker.io/token?service=registry.docker.io&scope=repository:${repo}:pull” \ | jq -r ‘.token’) curl -H “Accept: ${acceptM}” \ -H “Accept: ${acceptML}” \ -H “Authorization: Bearer $token” \ -I -s “https://registry-1.docker.io/v2/${repo}/manifests/${tag}” $ ./digest-v2.sh … Read more

systemd: “Environment” directive to set PATH

You can’t use EnvVars in Environment directives. The whole Environment= will be ignored. If you use EnvironmentFile=, then the specified file will be loaded without substitution. So PATH=/local/bin:$PATH would be exactly that, and this is probably not what you want. Under CentOS7 the following works. # /etc/systemd/system/nagios.service.d/env.conf [Service] Environment=”PATH=/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin” > sudo systemctl daemon-reload > sudo … Read more

Docker Compose to CoreOS

taken from https://docs.docker.com/compose/install/ the only thing is that /usr is read only, but /opt/bin is writable and in the path, so: sd-xx~ # mkdir /opt/ sd-xx~ # mkdir /opt/bin sd-xx~ # curl -L https://github.com/docker/compose/releases/download/1.3.3/docker-compose-`uname -s`-`uname -m` > /opt/bin/docker-compose % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left … Read more

Postgres – testing database connection in bash

pg_isready is a utility for checking the connection status of a PostgreSQL database server. The exit status specifies the result of the connection check. It can easily be used in bash. PostgresSQL Docs – pg_isready Example Usage: pg_isready -d <db_name> -h <host_name> -p <port_number> -U <db_user> Installation sudo apt install -y postgresql-client Exit Status pg_isready … Read more

Should I use forever/pm2 within a (Docker) container?

My take is do not use an in-container process supervisor (forever, pm2) and instead use docker restart policy via the –restart=always (or one of the other flavors of that option). This is more inline with the overall docker philosophy, and should operate very similarly to in-container process supervision since docker containers start running very quickly. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)