Step 2: Docker Account Setup
Contents
Step 2: Docker Account Setup#
Duckietown leverages containerization to ensure software portability and reproducibility.
Most procedures entail the use of docker
operations behind the scene.
That is why we need to set up the logins for docker within dts
.
We use DockerHub to distribute the containerized version
of its software modules, and most Duckietown procedures entail some docker
operations behind the scenes.
If you are unfamiliar with Docker, we strongly recommend reading the following reference page to gain a working understanding of this tool: The Duckietown Intro to Docker
1) Create a DockerHub account#
If you do not have one already, you can sign up for a DockerHub account at this link.
Make an access token#
Follow the instructions on this page to create a new personal access token on DockerHub.
2) Log in to Docker#
Once you have an account on DockerHub and an access token, you can test them by logging in using the command,
docker login -u DOCKER_USERNAME
where DOCKER_USERNAME
is the username you chose when signing up on DockerHub.
You will then be prompted for your password, paste the access token we created earlier and press
Enter.
3) Configure shell#
We are now going to provide the same username and access token to the shell in order to automate most of the back-end operations involving docker.
Attention
These credentials are only stored locally;
Never use your account password instead of an access token;
You can pass wour DockerHub credentials to the Duckietown Shell by running the following command,
dts config docker credentials set \
--username DOCKERHUB_USERNAME \
--password DOCKERHUB_ACCESS_TOKEN
For developers
With an extra positional argument, one could specify a custom docker registry server other than
docker.io
. Check dts config docker set --help
for more details.
Checkpoint ✅#
Before we move on, let us make sure you have set our credentials correctly.
Tip
Never skip a checkpoint!
If you have trouble with any of these commands, see the FAQs section below.
Test
If your Docker login was successful, you should be able to run
dts config docker credentials info
Expected Result
You should see an output similar to the following,
Docker credentials:
. registry: docker.io
. username: DOCKERHUB_USERNAME
. secret: DOCKERHUB_ACCESS_TOKEN
FAQs#
If you continue past a test that did not work, you will have further software issues down the line, and they will be more complex to fix. Instead, if you do not get the expected outcome at any checkpoint:
First check the troubleshooting guide below.
If you run into any issues that can’t be solved using the troubleshooting section, join the Duckietown community on StackOverflow and Slack following the instructions below and search for previous solutions.
You can join the Duckietown community on Slack at this link.
There you can request an invitation to the Duckietown Stack Overflow, in particular, following these instructions.
Troubleshooting
SYMPTOM
I mistakenly set a wrong/unwanted username or password. How can I update the credentials?
RESOLUTION
Just run the command again with the correct credentials. Only the latest inputs are stored for the same docker registry.
Troubleshooting
SYMPTOM
I would like to remove my stored docker credentials. How could I achieve that?
RESOLUTION
Simply use a text editor to remove the section docker-credentials
in ~/.dt-shell/config.yaml
file.