1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
16 // BusyboxDockerImage downloads the busybox:uclibc docker image
17 // (busybox_uclibc.tar) from cache.arvados.org into a temporary file
18 // and returns the temporary file name.
19 func BusyboxDockerImage(c *C) string {
20 fnm := "busybox_uclibc.tar"
22 cachefile := cachedir + "/" + fnm
23 if _, err := os.Stat(cachefile); err == nil {
27 f, err := ioutil.TempFile(cachedir, "")
30 defer os.Remove(f.Name())
32 resp, err := http.Get("https://cache.arvados.org/" + fnm)
34 defer resp.Body.Close()
35 _, err = io.Copy(f, resp.Body)
39 err = os.Rename(f.Name(), cachefile)