-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDockerfile
46 lines (32 loc) · 1.71 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM ghcr.io/jauderho/golang:1.23.5-alpine3.21@sha256:9d07aef84b1aabde0c5dddd3f6153a09551db52b840749400639398959368561 AS build
WORKDIR /go/src/github.com/multiprocessio/dsq/
ARG BUILD_VERSION
ARG ARCHIVE_URL=https://github.com/multiprocessio/dsq/archive/
ARG GIT_URL=https://github.com/multiprocessio/dsq.git
ENV CGO_ENABLED 0
RUN test -n "${BUILD_VERSION}" \
&& apk update \
&& apk upgrade -a \
&& apk add --no-cache git gcc musl-dev \
&& git clone --depth 1 ${GIT_URL} --branch ${BUILD_VERSION} /go/src/github.com/multiprocessio/dsq \
&& cd /go/src/github.com/multiprocessio/dsq \
&& go get -u google.golang.org/protobuf golang.org/x/net \
&& go get -u github.com/snowflakedb/gosnowflake \
&& go get -u golang.org/x/crypto golang.org/x/net \
&& go mod tidy \
&& go build -v -trimpath -ldflags="-s -w"
WORKDIR /config
# ----------------------------------------------------------------------------
#FROM scratch
FROM ghcr.io/jauderho/alpine:3.21.2@sha256:ae4eeb37e8b2b5b3ec8439c2f00f7fdce6939c7f3867a7c3d2a4dddbfa257d34
LABEL org.opencontainers.image.authors="Jauder Ho <[email protected]>"
LABEL org.opencontainers.image.url="https://github.com/jauderho/dockerfiles"
LABEL org.opencontainers.image.documentation="https://github.com/jauderho/dockerfiles"
LABEL org.opencontainers.image.source="https://github.com/jauderho/dockerfiles"
LABEL org.opencontainers.image.title="jauderho/dsq"
LABEL org.opencontainers.image.description="dsq is a CLI companion to DataStation (a GUI) for running SQL queries against data files"
RUN apk update \
&& apk upgrade -a
COPY --from=build /go/src/github.com/multiprocessio/dsq/dsq /usr/local/bin/dsq
COPY --from=build /config /config
ENTRYPOINT ["/usr/local/bin/dsq"]