Skip to content

Commit

Permalink
Move migrate binary to /usr/local/bin in Dockerfile
Browse files Browse the repository at this point in the history
Move the migrate binary to `/usr/local/bin` in the Dockerfile, so
it can be invoked from anywhere - this makes it easier to write
entrypoint scripts which call `migrate` that can be used
consistently both locally and in Docker containers.

To preserve backwards compatibility for anything that depends on
`migrate` existing at its existing path, we create a symlink to the
`/usr/local/bin/migrate` binary.
  • Loading branch information
jace-ys committed Mar 14, 2020
1 parent 8e142df commit 6cdebb0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ RUN apk add --no-cache ca-certificates

COPY --from=builder /usr/local/lib/libseabolt* /lib/

COPY --from=builder /go/src/github.com/golang-migrate/migrate/build/migrate.linux-386 /migrate
COPY --from=builder /go/src/github.com/golang-migrate/migrate/build/migrate.linux-386 /usr/local/bin/migrate
RUN ln -s /usr/local/bin/migrate /migrate

ENTRYPOINT ["/migrate"]
ENTRYPOINT ["migrate"]
CMD ["--help"]

0 comments on commit 6cdebb0

Please sign in to comment.