Skip to content

Commit 4b43266

Browse files
Prometheus2677FPiety0521
authored and
FPiety0521
committed
Move migrate binary to /usr/local/bin in Dockerfile
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.
1 parent 46d7427 commit 4b43266

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ RUN apk add --no-cache ca-certificates
3131

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

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

36-
ENTRYPOINT ["/migrate"]
37+
ENTRYPOINT ["migrate"]
3738
CMD ["--help"]

0 commit comments

Comments
 (0)