Skip to content

Conversation

@vvoland
Copy link
Contributor

@vvoland vvoland commented Mar 31, 2025

When using a staging download URL (containing "-stage" in the URL), and no explicit repo was provided automatically use the staging repo file as well.

(This only affects DNF distros)

So it's sufficient to do:

curl -L get.docker.com | DOWNLOAD_URL="https://download-stage.docker.com" sh -

instead of

curl -L get.docker.com | REPO_FILE="docker-ce-staging.repo" DOWNLOAD_URL="https://download-stage.docker.com" sh -

Signed-off-by: Paweł Gronowski pawel.gronowski@docker.com

@vvoland vvoland self-assigned this Mar 31, 2025
@vvoland vvoland requested a review from thaJeztah March 31, 2025 17:06
@vvoland
Copy link
Contributor Author

vvoland commented Apr 16, 2025

@thaJeztah PTAL

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment (at least the tab <--> spaces should be fixed 😄 )

install.sh Outdated
Comment on lines 102 to 110
DEFAULT_STAGING_REPO_FILE="docker-ce-staging.repo"

if [ -z "$REPO_FILE" ]; then
REPO_FILE="$DEFAULT_REPO_FILE"
# Automatically default to a staging repo fora
# a staging download url (download-stage.docker.com)
case "$DOWNLOAD_URL" in
*-stage*) REPO_FILE="$DEFAULT_STAGING_REPO_FILE";;
esac
Copy link
Member

@thaJeztah thaJeztah Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the new lines accidentally used spaces for indentation (I thought we had shfmt running in this repo, but looks like we don't? (we should add it).

Suggested change
DEFAULT_STAGING_REPO_FILE="docker-ce-staging.repo"
if [ -z "$REPO_FILE" ]; then
REPO_FILE="$DEFAULT_REPO_FILE"
# Automatically default to a staging repo fora
# a staging download url (download-stage.docker.com)
case "$DOWNLOAD_URL" in
*-stage*) REPO_FILE="$DEFAULT_STAGING_REPO_FILE";;
esac
DEFAULT_STAGING_REPO_FILE="docker-ce-staging.repo"
if [ -z "$REPO_FILE" ]; then
REPO_FILE="$DEFAULT_REPO_FILE"
# Automatically default to a staging repo for
# a staging download url (download-stage.docker.com)
case "$DOWNLOAD_URL" in
*-stage*) REPO_FILE="$DEFAULT_STAGING_REPO_FILE";;
esac

One thing I was looking at, but we already have some cases where we did, was to keep "internal" vars lowercase, so that it's slightly more clear which env-vars we expect users to be using for overrides. (We can't use local because that's not a POSIX thing).

Suggested change
DEFAULT_STAGING_REPO_FILE="docker-ce-staging.repo"
if [ -z "$REPO_FILE" ]; then
REPO_FILE="$DEFAULT_REPO_FILE"
# Automatically default to a staging repo fora
# a staging download url (download-stage.docker.com)
case "$DOWNLOAD_URL" in
*-stage*) REPO_FILE="$DEFAULT_STAGING_REPO_FILE";;
esac
default_staging_repo_file="docker-ce-staging.repo"
if [ -z "$REPO_FILE" ]; then
REPO_FILE="$DEFAULT_REPO_FILE"
# Automatically default to a staging repo for
# a staging download url (download-stage.docker.com)
case "$DOWNLOAD_URL" in
*-stage*) REPO_FILE="$default_staging_repo_file";;
esac

Or ... we could keep it simple, because we don't use that var anywhere else;

Suggested change
DEFAULT_STAGING_REPO_FILE="docker-ce-staging.repo"
if [ -z "$REPO_FILE" ]; then
REPO_FILE="$DEFAULT_REPO_FILE"
# Automatically default to a staging repo fora
# a staging download url (download-stage.docker.com)
case "$DOWNLOAD_URL" in
*-stage*) REPO_FILE="$DEFAULT_STAGING_REPO_FILE";;
esac
if [ -z "$REPO_FILE" ]; then
REPO_FILE="$DEFAULT_REPO_FILE"
# Automatically default to a staging repo for
# a staging download url (download-stage.docker.com)
case "$DOWNLOAD_URL" in
*-stage*) REPO_FILE="docker-ce-staging.repo";;
esac

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OH! There's a typo as well (fora -> for)

When using a staging download URL (containing "-stage" in the URL), and
no explicit repo was provided automatically use the staging repo file as
well.

So it's sufficient to do:

```
curl -L get.docker.com | DOWNLOAD_URL="https://download-stage.docker.com" sh -
```

instead of
```
curl -L get.docker.com | REPO_FILE="docker-ce-staging.repo" DOWNLOAD_URL="https://download-stage.docker.com" sh -
```

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit 5fed27b into docker:master Apr 17, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants