Fixed linting errors

This commit is contained in:
Jef Roosens 2022-02-25 21:54:16 +01:00
parent 732b53b6ce
commit 4a4362c138
Signed by untrusted user: Jef Roosens
GPG key ID: B580B976584B5F30
3 changed files with 12 additions and 9 deletions

View file

@ -20,8 +20,8 @@ pub struct NewContainer {
entrypoint []string [json: Entrypoint]
cmd []string [json: Cmd]
env []string [json: Env]
work_dir string [json: WorkingDir]
user string [json: User]
work_dir string [json: WorkingDir]
user string [json: User]
}
struct CreatedContainer {

View file

@ -14,6 +14,8 @@ pub fn pull_image(image string, tag string) ?http.Response {
return request('POST', urllib.parse('/v1.41/images/create?fromImage=$image&tag=$tag') ?)
}
// create_image_from_container creates a new image from a container with the
// given repo & tag, given the container's ID.
pub fn create_image_from_container(id string, repo string, tag string) ?Image {
res := request('POST', urllib.parse('/v1.41/commit?container=$id&repo=$repo&tag=$tag') ?) ?
@ -24,6 +26,7 @@ pub fn create_image_from_container(id string, repo string, tag string) ?Image {
return json.decode(Image, res.text) or {}
}
// remove_image removes the image with the given ID.
pub fn remove_image(id string) ?bool {
res := request('DELETE', urllib.parse('/v1.41/images/$id') ?) ?