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

Dockerization #24

Merged
merged 1 commit into from
May 9, 2018
Merged

Dockerization #24

merged 1 commit into from
May 9, 2018

Conversation

Its-Alex
Copy link
Contributor

@Its-Alex Its-Alex commented May 8, 2018

Linked to #23

I don't use travis ci but according to the documentation you need to setup environments variable from cli then added hash to .travis.yml ?

Image currently weighs 13.8MB

Copy link
Member

@dhui dhui 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 taking a crack at this!

Once this PR has been merged, I'll update the credentials to push the image to docker hub and create a new release

Dockerfile Outdated
@@ -0,0 +1,22 @@

FROM golang:1.10-stretch as downloader
Copy link
Member

Choose a reason for hiding this comment

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

Use

FROM golang:1.10-alpine3.7 AS downloader
RUN apk add --no-cache git gcc musl-dev

That way you won't need glibc below. musl should be compatible with glibc

Dockerfile Outdated
go get -u github.com/kshvakov/clickhouse && \
GOOS=linux GOARCH=386 go build -a -o build/migrate.linux-386 -ldflags='-X main.Version=$(VERSION)' -tags '$(DATABASE) $(SOURCE)' ./cli

FROM frolvlad/alpine-glibc
Copy link
Member

Choose a reason for hiding this comment

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

Use

FROM alpine:3.7
RUN apk add --no-cache ca-certificates

musl should work instead of glibc and I'd prefer to only depend on official docker images. Also, we'll need the certs for remote sources.

.travis.yml Outdated
@@ -7,6 +7,8 @@ go:

env:
- MIGRATE_TEST_CONTAINER_BOOT_TIMEOUT=60
- secure: "ENCYRYPTED USERNAME"
Copy link
Member

@dhui dhui May 8, 2018

Choose a reason for hiding this comment

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

Remove these environment variables for now since it's creating extra TravisCI builds. I'll figure out a way to safely pass in credentials once this PR is merged.

@Its-Alex
Copy link
Contributor Author

Its-Alex commented May 9, 2018

To add encrypted variable you should do this (cf https://docs.travis-ci.com/user/environment-variables/#Defining-encrypted-variables-in-.travis.yml)

$ travis encrypt DOCKER_USERNAME=username --add env.global
$ travis encrypt DOCKER_PASSWORD=password --add env.global

With env.global this will not trigger extra build

Signed-off-by: Alexandre MARRE <[email protected]>
@dhui dhui merged commit a0b03c3 into golang-migrate:master May 9, 2018
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