github.com/amacneil/dbmate@v1.16.3-0.20230225174651-ca89b10d75d7/Dockerfile (about)

     1  # development image
     2  FROM golang:1.19 as dev
     3  WORKDIR /src
     4  RUN git config --global --add safe.directory /src
     5  
     6  # install database clients
     7  RUN apt-get update \
     8  	&& apt-get install -qq --no-install-recommends \
     9  		curl \
    10  		file \
    11  		mariadb-client \
    12  		postgresql-client \
    13  		sqlite3 \
    14  	&& rm -rf /var/lib/apt/lists/*
    15  
    16  # golangci-lint
    17  RUN curl -fsSL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
    18  	| sh -s -- -b /usr/local/bin v1.50.1
    19  
    20  # download modules
    21  COPY go.* /src/
    22  RUN go mod download
    23  COPY . /src/
    24  RUN make build
    25  
    26  # release stage
    27  FROM alpine as release
    28  RUN apk add --no-cache \
    29  	mariadb-client \
    30  	mariadb-connector-c \
    31  	postgresql-client \
    32  	sqlite \
    33  	tzdata
    34  COPY --from=dev /src/dist/dbmate /usr/local/bin/dbmate
    35  ENTRYPOINT ["/usr/local/bin/dbmate"]