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

Fix #216 added support for user with x509 enabled #294

Merged

Conversation

arulrajnet
Copy link
Contributor

- Dockerfile for multi stage build

- steps for building binary file
cmd/goose/driver_mysql.go Outdated Show resolved Hide resolved
@arulrajnet
Copy link
Contributor Author

Hi @mfridman

Do I need to run any other checks / tests for this PR?

Dockerfile Outdated Show resolved Hide resolved
@mfridman
Copy link
Collaborator

Hi @mfridman

Do I need to run any other checks / tests for this PR?

No, all the tests pass. We'd prefer if you added (even if hard coded) test, but otherwise I need to test to make sure it's doing the right thing. (fwiw the code looks correct).

- return error if failed to load x509 keypair
cmd/goose/driver_mysql.go Outdated Show resolved Hide resolved
- update readme and rename Dockerfile as Dockerfile.local

COPY . /src
WORKDIR /src
RUN CGO_ENABLED=0 make dist
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mfridman Added CGO_ENABLED=0 to be consistant with release build.

Refer https://github.com/pressly/goose/blob/master/.goreleaser.yml#L9

Without that, it's not working with alpine based docker images.

I have tested with this

FROM alpine:3.15

COPY --from=builder /src/bin/goose-linux64 /usr/local/bin/goose
RUN chmod +x /usr/local/bin/goose
RUN apk --no-cache add curl
RUN curl -ksSL https://raw.githubusercontent.com/cloudflare/cfssl/master/certdb/sqlite/migrations/001_CreateCertificates.sql -o 001_CreateCertificates.sql
RUN goose sqlite3 ./data.db up
RUN goose sqlite3 ./data.db status

Giving following error if the image is alpine. The same binary is working perfect in debian based images.
2021-12-12_11-28

After adding CGO_ENABLED=0

2021-12-12_11-26

Working in both debian and alpine based images.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks, iirc this might be related to golang/go#28065 (I haven't kept up whether this is still the state of the world).

Copy link
Collaborator

@mfridman mfridman left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution.

@mfridman mfridman merged commit fd1ba04 into pressly:master Dec 12, 2021
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.

2 participants