From be345e0733d2c025e4082c5154e441317ae94cf7 Mon Sep 17 00:00:00 2001 From: prathamesh0 <42446521+prathamesh0@users.noreply.github.com> Date: Fri, 22 Jul 2022 11:44:07 +0530 Subject: [PATCH] Use a specific tag while building migration tool (#101) --- Dockerfile | 3 ++- Makefile | 8 ++++---- db/Dockerfile | 23 ----------------------- docker-compose.yml | 2 +- 4 files changed, 7 insertions(+), 29 deletions(-) delete mode 100644 db/Dockerfile diff --git a/Dockerfile b/Dockerfile index f96391d..bf65fe3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,8 @@ ADD . /go/src/github.com/vulcanize/ipld-eth-db # Build migration tool WORKDIR /go/src/github.com/pressly -RUN git clone https://github.com/pressly/goose.git +ARG GOOSE_VER="v3.6.1" +RUN git clone --depth 1 --branch ${GOOSE_VER} https://github.com/pressly/goose.git WORKDIR /go/src/github.com/pressly/goose/cmd/goose RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -tags='no_sqlite3' -o goose . diff --git a/Makefile b/Makefile index 9beb5f4..9b3367e 100644 --- a/Makefile +++ b/Makefile @@ -117,10 +117,10 @@ import: docker-build: docker-compose -f docker-compose.test.yml build -## Build docker image for migration -.PHONY: docker-concise-migration-build -docker-concise-migration-build: - docker build -t vulcanize/concise-migration-build -f ./db/Dockerfile . +# ## Build docker image for migration +# .PHONY: docker-concise-migration-build +# docker-concise-migration-build: +# docker build -t vulcanize/concise-migration-build -f ./db/Dockerfile . .PHONY: test-migrations test-migrations: $(GOOSE) diff --git a/db/Dockerfile b/db/Dockerfile deleted file mode 100644 index ea2bedf..0000000 --- a/db/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM golang:1.18-alpine as builder - -RUN apk --update --no-cache add make git g++ linux-headers - -ADD . /go/src/github.com/vulcanize/ipld-eth-db - -# Build migration tool -WORKDIR /go/src/github.com/pressly -RUN git clone https://github.com/pressly/goose.git -WORKDIR /go/src/github.com/pressly/goose/cmd/goose -RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -tags='no_sqlite3' -o goose . - -# app container -FROM alpine - -WORKDIR /app - -COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/scripts/startup_script.sh . - -COPY --from=builder /go/src/github.com/pressly/goose/cmd/goose/goose goose -COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/db/migrations migrations/vulcanizedb - -ENTRYPOINT ["/app/startup_script.sh"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 51bf9c0..6e517c7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,7 @@ services: depends_on: - ipld-eth-db # Use an existing image - image: vulcanize/ipld-eth-db:v4.1.4-alpha + image: vulcanize/ipld-eth-db:v4.2.1-alpha environment: DATABASE_USER: "vdbm" DATABASE_NAME: "vulcanize_testing"