Skip to content

Commit 4eecb87

Browse files
committed
fix: account for architecture
1 parent 3286464 commit 4eecb87

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

migrations/Dockerfile.dbmate

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
FROM debian:bullseye-slim
22

3-
RUN apt-get update && apt-get install -y curl \
4-
&& curl -fsSL -o /usr/local/bin/dbmate https://github.com/amacneil/dbmate/releases/latest/download/dbmate-linux-amd64 \
5-
&& chmod +x /usr/local/bin/dbmate
3+
RUN apt-get update && apt-get install -y curl wget gnupg2 lsb-release
4+
5+
RUN ARCH=$(dpkg --print-architecture); \
6+
case ${ARCH} in \
7+
amd64) DBMATE_ARCH="linux-amd64" ;; \
8+
arm64) DBMATE_ARCH="linux-arm64" ;; \
9+
*) echo "Unsupported architecture: ${ARCH}"; exit 1 ;; \
10+
esac && \
11+
curl -fsSL -o /usr/local/bin/dbmate \
12+
https://github.com/amacneil/dbmate/releases/latest/download/dbmate-${DBMATE_ARCH} && \
13+
chmod +x /usr/local/bin/dbmate
614

7-
RUN apt-get update && apt-get install -y wget gnupg2 lsb-release
815
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
916
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
1017
RUN apt-get update && apt-get install -y postgresql-client-%VERSION%
1118

1219
ENV PATH="/usr/lib/postgresql/%VERSION%/bin:${PATH}"
1320

21+
RUN dbmate --version
22+
1423
ENTRYPOINT ["dbmate"]

0 commit comments

Comments
 (0)