Skip to content
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

Add cloudsql build scripts. #4

Merged
merged 2 commits into from
Jan 12, 2016
Merged

Add cloudsql build scripts. #4

merged 2 commits into from
Jan 12, 2016

Conversation

dlorenc
Copy link
Contributor

@dlorenc dlorenc commented Jan 11, 2016

No description provided.

@@ -0,0 +1,4 @@
FROM scratch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scratch?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cloudsql proxy is a statically-built binary. It doesn't need anything else (other than the root x509 certs for TLS connections, but those already reside on the VM are are mapped into the container).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added a second commit to make sure we statically build it :)
$ docker run f013
2016/01/11 23:59:23 No authentication method available! When not running on Google Compute Engine, provide the -credential_file flag.

@dlorenc
Copy link
Contributor Author

dlorenc commented Jan 11, 2016

R: @andrewsg

go get github.com/GoogleCloudPlatform/cloudsql-proxy/...
echo "Building in $DEST"

go build -o cloud_sql_proxy github.com/GoogleCloudPlatform/cloudsql-proxy/cmd/cloud_sql_proxy/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need a few more commands for the output binary to be in the correct format. This is what I used in the past:

CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o cloud_sql_proxy
github.com/GoogleCloudPlatform/cloudsql-proxy/cmd/cloud_sql_proxy/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be there in the second commit. Thanks!

@andrewsg
Copy link
Member

LGTM

dlorenc added a commit that referenced this pull request Jan 12, 2016
@dlorenc dlorenc merged commit a49c40d into master Jan 12, 2016
@dlorenc dlorenc deleted the cloudsql branch January 12, 2016 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants