Note for awk command on Mac


Today, I cleaned up redundant Docker images.

I used this command line:
docker rmi $(docker images | grep "^<none>" | awk "{print $3}")

But it does not works on macOS, only Linux.

After some hours, I found the problem, and the right command for macOS is:
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')

awk on macOS isn’t same as awk on Linux. So you will use different syntaxes.

Limit elasticsearch official docker container memory

Elastic Search
  1. Pull Elasticseach official docker image:
    docker pull
  2. Run new container with parameter -e "ES_JAVA_OPTS=-Xms256m -Xmx1g":
    docker run -d \
    --net meete \
    --name elasticsearch \
    --hostname elasticsearch \
    -e "ES_JAVA_OPTS=-Xms256m -Xmx1g" \
    -e "" \
    -e "" \
    -e "" \

Reference link:

%d bloggers like this: