-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image import from tar archives #75
Conversation
…), Services and Jobs frontend componenets can handle empty lists correctly
Makefile
Outdated
@@ -10,14 +10,14 @@ webui: | |||
|
|||
containers: | |||
(cd $(INTERNALSERVICES)/volume-stage-in && docker build -t volume-stage-in .) | |||
(cd $(INTERNALSERVICES)/volume-filelist && GOOS=linux GOARCH=amd64 go build && docker build -t volume-filelist .) | |||
(cd $(INTERNALSERVICES)/volume-filelist && GOOS=linux GOARCH=amd64 go build -ldflags -s && docker build -t volume-filelist .) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please define GOFLAGS=-ldflags -s
at the top of the makefile and use go build $(GOFLAGS)
where needed, this way we can change the flags once.
if _, err := os.Stat(filepath.Join(buildDir, "Dockerfile")); os.IsNotExist(err) { | ||
Response{w}.ServerError("no Dockerfile to build new image ", err) | ||
return | ||
if strings.HasSuffix(strings.ToLower(part.FileName()), ".tar") || strings.HasSuffix(strings.ToLower(part.FileName()), ".tar.gz") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic is not perfect here. I would first save all the files on the file system, and then 1. if there exists a Dockerfile, assume build image is expected, or 2. if there is a single tar file, assume an image.
Right now the user may send a Dockerfile together with a .tar file that is used in the Dockerfile, and the assumption that the .tar file is an image would be incorrect.
Image import from tar archives has been implemented. Metadata is extracted from Manifest.json, since there is a problem with the Docker remote API (fsouza/go-dockerclient#645 (comment)). Makefile has been modified to work on Mac (the last update made go partly incompatible with the latest XCode). Services.jsx and Jobs.jsx do not throw exceptions when an empty list is found, instead we show a simple message. Updated React-Dropzone component, but it still cannot handle correctly multiple file upload: uploading is done in chunks of two files (by default), ImageBuild fails, if a Dockerfile is not in the first chunk (has to be investigated #74).