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
Fix makefile build/run under Mac #15
Conversation
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
@@ -1,6 +1,6 @@ | |||
TAG=$(shell date -I -u) | |||
TAG=$(shell date -u +"%Y-%m-%dT%H-%M-%S") |
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.
No, this produces e.g.
2017-01-12T19-11-56
whereas I wanted e.g.
2017-01-12
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.
Not sure why that specific format for the date, but I changed it
IMAGE=jenkinsci/workflow-demo | ||
DOCKER_RUN=docker run --rm -p 127.0.0.1:2222:2222 -p 127.0.0.1:8080:8080 -p 127.0.0.1:8081:8081 -p 127.0.0.1:9418:9418 -ti | ||
DOCKER_RUN=docker run --rm -p 2222:2222 -p 8080:8080 -p 8081:8081 -p 9418:9418 -ti |
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.
No, this would make the demo unsafe to run on public WiFi.
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.
@jglick How do you propose to make the demo runnable on Mac, then?
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.
Added a solution - not the prettiest but it will get the job done.
Per review from @jglick
This keeps security while allowing docker-machine compatibility
Ugh, nevermind, the docker info still doesn't distinguish between the local and remote servers for IP. I can't find a good way to detect a local vs. a docker-machine docker server. |
Closing this because I'm pretty sure there's not a way to make this handle docker-machine vs. native correctly. |
This is due to a subtle difference between the Linux and Mac 'date' command version which breaks the makefile. This fixes it.
It also fixes explicitly setting an ip address that may not match for docker-machine hosts vs. native docker.
@reviewbybees esp @jglick