Commit graph

20 commits

Author SHA1 Message Date
CrazyMax
25dc760162
Dockerfile: variant support in frozen-images stage
using TARGETVARIANT in frozen-images stage implies changes in
`download-frozen-image-v2.sh` script to add support for variants
so we are able to build against more platforms.

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-11-17 20:57:12 +01:00
cuishuang
9efa8b3500 all: fix typos
Signed-off-by: cuishuang <imcusg@gmail.com>
2022-03-01 14:26:35 +08:00
Brian Goff
dedf8528a5 Allow download-frozen-images to work without go
Currently we use the `go` command to read GOARCH and use the value for
matching manifests.

This change allows:

1. Specifying the arch through `TARGETARCH`
2. Falling back to `dpkg` if `go` is not available
3. Falling back to `uname -m` if `dpkg` is not available
4. A default value (amd64) if none of these commands is available.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-09-28 19:10:16 +00:00
Cristian Ariza
6fabb93f73 Make script pass shellcheck
Signed-off-by: Cristian Ariza <dev@cristianrz.com>
2020-06-12 17:39:29 +00:00
cristianrz
7608e42da5 Fix curl progress flags
Signed-off-by: Cristian Ariza <dev@cristianrz.com>
2020-05-06 12:39:28 +01:00
Akihiro Suda
3cf82748dd run shfmt
git grep --name-only '^#!' | egrep -v '(vendor|\.go|Jenkinsfile)' | xargs shfmt -w -bn -ci -sr

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-03 12:27:49 +09:00
Mark Jeromin
60ec93f7c2 Fix error handling when go command is missing
Signed-off-by: Mark Jeromin <mark.jeromin@sysfrog.net>
2018-11-04 23:34:03 -05:00
Christopher Jones
24da8a0ed4
[ci] use alternate bash comparison
The pattern `echo str | grep -qE pattern` likes to fail on the z CI here for
an unknown reason. Use `grep -qE pattern <<< str` instead.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
2018-01-12 11:05:20 -05:00
Dennis Chen
0af5db511e Download support of images with multi-arch manifest
Currently we only support 'application/vnd.docker.distribution.manifest.v2+json'
manifest images download, with more multi-arch images used, we need to support
download images with 'application/vnd.docker.distribution.manifest.list.v2+json'
format(aka "fat manifest"), else we will fail to download those multi-arch ones.

This PR adds 'application/vnd.docker.distribution.manifest.list.v2+json' manifest
support, thus we can download both multi-arch and legacy images.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
2017-12-14 05:37:22 +00:00
Jacob Wen
238d17c456 Handle https proxy's CONNECT response
When using a https proxy, an extra HTTP 200 header will be generated.
So we can't rely on detecting the first http header.

$curlHeaders with https proxy:
"HTTP/1.0 200 Connection established  <-- the https proxy's response

HTTP/1.1 307 Temporary Redirect
...
"

See https://stackoverflow.com/a/34537988/889429

Fixes #34131

Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
2017-07-21 10:13:04 +08:00
Tianon Gravi
4bbdc0b8f7 Update "download-frozen-image-v2.sh" such that redirects are optional
If the registry responds directly with blob contents, use them,
otherwise follow the redirect without Authorization headers (which
likely aren't valid for the server being redirected to).

This preserves the basic structure of the previous output with up to one
additional progress bar per-layer (for the redirect request and then the
following blob request).

Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
2017-06-22 15:54:50 -07:00
Alexander Midlash
5c38e4c16a Update downloader script, to ensure that Authorization header is not passed when downloading blobs.
Signed-off-by: Alexander Midlash <amidlash@docker.com>
2017-06-22 15:54:50 -07:00
vanderliang
cb502cd4e8 Fix downloading image fails when build docker
Generate a token for each download process to avoid token expired.

Closes: #33441

Signed-off-by: vanderliang <lansheng@meili-inc.com>
2017-05-31 14:21:32 +08:00
Tianon Gravi
52379fa76d Convert script shebangs from "#!/bin/bash" to "#!/usr/bin/env bash"
This is especially important for distributions like NixOS where `/bin/bash` doesn't exist, or for MacOS users who've installed a newer version of Bash than the one that comes with their OS.

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2017-02-13 11:01:54 -08:00
Tianon Gravi
356dc712a6 Update "download-frozen-image-v2.sh" for schemaVersion 2
Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2017-01-26 11:08:28 -08:00
Antonio Murdaca
887bc48319
contrib: download-frozen-image-v2.sh requires jq
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-12-01 12:40:58 +01:00
Shijiang Wei
05b05a358f request a new token before downloading each layer
Fixes #20069

Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-02-14 16:56:07 +08:00
Justas Brazauskas
927b334ebf Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
2015-12-13 18:04:12 +02:00
John Howard
c07e79fa8a Windows CI Fix: Allow bash v4
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-12-06 14:40:29 -08:00
Jessica Frazelle
359d0c247f
update download-frozen-image.sh to v2 registry
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
2015-12-01 13:16:42 -08:00