Week 3 assignment

Hi everyone,
I am working on the docker questions and can’t seem to get the 3.11 version of Alpine to answer question 7. I am using
docker pull alpine-3.11
and am getting the following error:
Error response from daemon: pull access denied for alpine-3.11, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied
I am not familiar with using docker, nor am I familiar with bash, so these exercises have been a big hurdle for me. I am unsure if I am writing the command wrong, or if the old version is no longer available? When I run
docker pull alpine
docker run alpine
docker run alpine cat /etc/alpine-release
I get version 3.12.1

I answered my own question, so I wanted to share for others:
docker run -t alpine:3.11 cat /etc/os-release

Using -t allows me to add the :3.11 tag :slight_smile:

1 Like

Great question @LanaRuvvy, and this brings up the important concept of tags. Every image on dockerhub is tagged, typically at least with the tag latest. Whenever a docker pull command is run without specifying a tag, docker assumes you want latest.
So when you type the command docker pull alpine, docker actually runs docker pull alpine:latest. The syntax is docker pull <image>:<tag>, which is why docker pull alpine-3.11 did not work, what docker executed was docker pull alpine-3.11:latest which does not exist on dockerhub.

latest by default refers to the most recent version of the image, so with the alpine example, you got version 3.12.1, if you were to run the same command next year (or likely even next month), you could get a different version, like 3.12.2 or 3.13.1.
That’s why being explicit with tags when you can is important because docker run alpine may have different output depending on when you run it. For example, if you are trying to re-run fmriprep from a year ago, and you used the latest tag (which corresponded to version 1.5.1 then), but today the latest tag points to version 20.2.0 (with ~20 releases separating the versions). So if you used the same docker run poldracklab/fmriprep command from a year ago, you will likely get different outputs.
A more “reproducible” way to run fmriprep is to specify the tag, so if you ran docker run poldracklab/fmriprep:1.5.1 a year ago, and re-run the same command today, you should get reproducible* output.

Hope that helps and provides some context on how tags are used and why they are important.

(P.S. also please anyone correct/add to my answer if I missed something or mischaracterized something).


Hi @jdkent and @LanaRuvvy,
I’m an observer student late to the assignment and can’t locate the link on the week 3 materials page.
Are you guys looking at the Canvas questions? Also thanks for sharing.

sorry about that, here is a link to the questions: https://docs.google.com/forms/d/e/1FAIpQLSfZF-hHM5zNdcIscL3sq8q7pmhlna4OOtKM57sQXzr1tkpnFA/viewform.

I’ll take a look at getting this added to the webpage.

1 Like

Thank you @jdkent for answering my question so thoroughly :slight_smile: Again as someone completely new to working in the terminal, I am facing a really steep learning curve and feel unequipped to complete the exercises given my lack of abilities here. I am wondering if step-by-step solutions to the assignments will be available? This would be really helpful to have. Thank you so much!

Hi @petra. We thought we had put the Week 3 quiz up for Observer students last Friday on the materials page but didn’t know it wasn’t actually up until we saw your comment. Thank you for cuing us into that and we’re super sorry we flubbed that one! It is up on the materials page now. Thanks @jdkent for posting the link here as well!

No worries! Incidentally, can you explain (unless it comes up in the Q&A which I’ll watch later) if I’m actually doing anything wrong here, or if this is just a google forms thing? image