Instructions to install Docker on macOS for which user does not have Admin privileges. These instructions are meant for iMacs in Biochem 201 but should work elsewhere.
Applications
directoryOptional: register with Docker
Docker.dmg
. This
will open a window suggesting to copy the Docker
icon onto
the Applications
folder. However, this action would require
Admin privileges.The easiest way to install applications is to create a new folder
within your username area, which can also be called
Applications
.
One way is to right-click and request a new directory.
Docker
icon into the Applications
folder just created.Docker
iconSystem
and choose
User
button.Fill-in or Skip the short survey.
Docker is now ready to use. Check that the engine is running at the bottom left of the main window.
A top-menu icon is available to access Docker Desktop, offering detailed menus.
It is important to follow the instructions given above within the
User
settings to provide the necessary information to macOS
since the Users Applications
folder we created is not in a
standard location.
The instructions were: You need to manually add
$HOME/.docker/bin
to your PATH
.
Unfortunately, the “Learn more” link does not contain the clear instructions needed, which are detailed below.
To make this a permanent change, the instruction has to be added to a
hidden file specific to the shell used. On newer macOS, the default
shell is zsh
but some users keep the older
bash
option. Select below the command matching your
shell.
Start by opening Terminal
and inquire which shell it is
using:
echo $SHELL
The answer may be either /bin/bash
or
/bin/zsh
Add the command to the “resource” file with the command below mathing the shell in use:
# for bash
echo "export PATH=$HOME/.docker/bin:$PATH" >> ~/.bashrc
# for zsh
echo "export PATH=$HOME/.docker/bin:$PATH" >> ~/.zshrc
This means that this line will be activated the next time a Terminal is open.
Docker is now ready to be used with the usual commands.