-
Notifications
You must be signed in to change notification settings - Fork 91
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
[New Feature] Ability to build dockerfile located inside sub-directories #102
Conversation
Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
PR for the Documentation: #103 |
Documenting the 'context' keyword as part of PR #102
@@ -1,6 +1,10 @@ | |||
#use the golang base image | |||
FROM golang:1.7 | |||
MAINTAINER Daniël van Gils | |||
LABEL MAINTAINER="Daniël van Gils" |
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.
Oh! I didn't know that it was deprecated almost one and a half years ago. Good catch.
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 am sorry, I should have added a comment to explain this. Happy to help :)
@@ -34,3 +34,6 @@ habitus_linux_386 | |||
habitus_linux_amd64 | |||
habitus_linux_arm | |||
launch.json | |||
|
|||
# Habitus-Generated Dockerfiles | |||
*.generated |
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.
👍
Dockerfile.tester
Outdated
@@ -5,10 +5,11 @@ MAINTAINER Daniël van Gils | |||
#get all the go testing stuff | |||
RUN go get github.com/onsi/ginkgo/ginkgo | |||
RUN go get github.com/onsi/gomega | |||
RUN go get github.com/sirupsen/logrus |
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.
Aha! I was wondering why go couldn't find the vendored Sirupsen/logrus... It turns out the author renamed his github username from capitalized to not.
So, good catch. Probably we need both sirupsen/logrus
either vendored or installed sysem-wide to make it work. Makes sense.
build/manifest.go
Outdated
@@ -45,6 +45,7 @@ type Step struct { | |||
Name string | |||
Label string | |||
Dockerfile string | |||
Context string |
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.
Would you mind running find . -path ./vendor -prune -type f -o -name '*.go' -exec gofmt -w {} +
and see if it fixes this indentation issue?
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.
Oh right, I was not aware of the gofmt
command, cool!
It is done.
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.
Thank you so much for your contribution.
Code LGTM! Only minor comment about code format. I can fix the siruspen/logrus issue on my own, but appreciate it if you could run dep ensure -add github.com/sirupsen/logrus
to see if it fixes the issue without the Dockerfile change.
Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
Signed-off-by: Damien DUPORTAL <damien.duportal@gmail.com>
Hello @mumoshu ! I have added the 2 following changes to the PR:
I am sure the dependency management could be improved (by removing all the "go get" instructions on the Dockerfiles, and by automatizing the dep command at build time). But I would like to make this PR an "atomic" change, and track the dependency solving on another PR if possible. |
Thank you @dduportal and @mumoshu This should go out next week on Tuesday. |
Hello @khash , thanks a lot! Let us know when it will be released :) |
@dduportal @mumoshu v1.0.3 is now released! Thank you very much for the help and your contributions! |
cc @Kasia66 for Cloud 66 changelog. |
Hello dear maintainers! Thank you for this piece of software.
This Pull Request aims at implementing #83 .
It introduces the following changes:
The keyword
context
can be used for each step, in order to run the build of this step inside a sub-folder.docker build
convention to be coherent: https://docs.docker.com/engine/reference/commandline/build/#extended-descriptionIgnoring the files with the extension
.generated
. These are the Dockerfiles generated by habitus and should not be tracked.The test suite has been fixed by adding the
go get
. It is currently failing on the cloud66/master branc (both test and crosscompile) with the following error message:=> As I understand, it sounds like that the vendored
github.com/docker/docker
dependency is not resolving its own dependency transitively. I don't know anything about Golang's dependency management so I did it "blindly" to make it work.Do not hesitate to comment the code, but please give me guidance for improvmeent if needed: I learnt Golang today and used this feature as a first real case (and as an excuse to learn).