Documentation
¶
Overview ¶
Package gogetdockerimage contains functions to download and save docker images.
Index ¶
- func DownloadImage(imageName string) error
- func GetImagesFromDockerCompose(dockerfilePath string) ([]string, error)
- func GetImagesFromDockerfile(dockerfilePath string) ([]string, error)
- func GetOutputName(image string) (string, error)
- func RemoveDir(dir string) error
- func SSHCopyFile(user, pass, addr, srcPath, dstPath string) error
- func SaveImage(imageName, outDir, outName string) error
- type RemoteDestination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadImage ¶
DownloadImage download docker image by name.
func GetImagesFromDockerCompose ¶
GetImagesFromDockerCompose returns all images found in given docker-compose file. It search for occurrences of "image: <imageName>" or "image: "<imageName>"" Search is performed case insensitive.
func GetImagesFromDockerfile ¶
GetImagesFromDockerfile returns all images found in given Dockerfile. It search for occurrences of "FROM imageName" or "FROM imageName AS alias" Search is performed case insensitive. Declaration of scratch is ignored.
func GetOutputName ¶
GetOutputName returns name of generated file from image name foo -> foo.docker.img foo/bar -> foo_bar.docker.img foo/bar:42 -> foo_bar_42.docker.img
func SSHCopyFile ¶
SSHCopyFile copies a file from srcPath to dstPath on the provided host. Host url can include port (ie. "10.20.300.400:22")
Types ¶
type RemoteDestination ¶
RemoteDestination represents a destination on a remote host. It contains user name, remote address (containing port number) and folder on remote host.
func ParseDestination ¶
func ParseDestination(urlString string) (*RemoteDestination, error)
ParseDestination parses the given url and returns new RemoteDestination. Url is expected to be in the format: ssh://user@10.20.300.400:22.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
getdockerimage
command
SPDX-FileCopyrightText: 2021 Eric Neidhardt SPDX-License-Identifier: MIT
|
SPDX-FileCopyrightText: 2021 Eric Neidhardt SPDX-License-Identifier: MIT |
|
internal
|
|
|
verify
Package verify provides utility functions for tests.
|
Package verify provides utility functions for tests. |