Category: DevOps

cloud platforms, containers and the pipelines that ship them.

  • autocomplete az commands in zsh on a mac

    the following script assumes that you have the az command installed on your mac. if you have installed it using homebrew then it copies the auto-completion file to the location /opt/homebrew/etc/bash_completion.d/az already. all we have to do is to make it auto load on zsh startup. copy and paste the following command to do it. restart your zsh (cmd+q) after entering this command.

    [[ -f /opt/homebrew/etc/bash_completion.d/az ]] && echo -e '\n# azure cli auto completion\nautoload -U +X bashcompinit && bashcompinit\nsource /opt/homebrew/etc/bash_completion.d/az' >> ~/.zshrc || echo 'autocomplete file not found'
  • configure docker host with remote api on your linux machine

    step 1: install docker engine. follow steps for your os from the docker documentation here – https://docs.docker.com/engine/install/

    step 2: assuming that you’re using ubuntu, open the file docker.service located at the path /lib/systemd/system/docker.service

    step 3: search for the line which says ExecStart. by default it should have something like this ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock . add the argument -H tcp://0.0.0.0:2376 to the dockerd command. the final command should look like this `ExecStart=/usr/bin/dockerd -H fd:// -H tcp://0.0.0.0:2376 --containerd=/run/containerd/containerd.sock

    step 4: we need to reload the systemd daemon and restart the docker service. use the command systemctl daemon-reload && systemctl restart docker.service to achieve this.

    step 5: test the change. run curl -s http://<ip_address_of_host>:2376 this should spit out the json message showing docker versions. if this doesnt work, make sure the firewall allows you to connect to this port.