I need to update all docker images through console command. Full list:
andrey@BushM1 ~ % docker images --format "{{.Repository}}" | sort --unique
bitnami/kafka
bitnami/zookeeper
confluentinc/cp-kafka
confluentinc/cp-kafka-connect
confluentinc/cp-schema-registry
confluentinc/cp-zookeeper
denoland/deno
mariadb
mcr.microsoft.com/azure-sql-edge
mcr.microsoft.com/dotnet/aspnet
mcr.microsoft.com/dotnet/runtime
mcr.microsoft.com/dotnet/sdk
mongo
mongo-express
mysql
node
portainer/portainer-ce
postgres
provectuslabs/kafka-ui
python
rabbitmq
redis
traefik
vault
wordpress
andrey@BushM1 ~ %
I need something like this:
andrey@BushM1 ~ % docker pull $(docker images --format "{{.Repository}}" | sort --unique)
"docker pull" requires exactly 1 argument.
See 'docker pull --help'.
Usage: docker pull [OPTIONS] NAME[:TAG|@DIGEST]
Pull an image or a repository from a registry
andrey@BushM1 ~ %
How to write right iteration?
1条答案
按热度按时间ve7v8dk21#
Sounds like a typical job for xargs:
See
man xargs
for more options. You can also just do a loop: