-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile
46 lines (38 loc) · 1.13 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
46
FROM golang:1.23 AS builder
RUN set -ex \
&& apt-get update --fix-missing \
&& apt-get install -qy --no-install-recommends \
unzip sudo \
ocl-icd-opencl-dev
WORKDIR /src
COPY Makefile* .
RUN make get-postrs-lib
# We want to populate the module cache based on the go.{mod,sum} files.
COPY go.mod .
COPY go.sum .
RUN go mod download
# Here we copy the rest of the source code
COPY . .
# And compile the project
RUN --mount=type=cache,id=build,target=/root/.cache/go-build make build
FROM ubuntu:22.04 AS postcli
ENV DEBIAN_FRONTEND noninteractive
ENV SHELL /bin/bash
USER root
RUN set -ex \
&& apt-get update --fix-missing \
&& apt-get install -qy --no-install-recommends \
locales \
ocl-icd-libopencl1 clinfo \
pocl-opencl-icd libpocl2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& locale-gen en_US.UTF-8 \
&& update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
ENV LC_ALL en_US.UTF-8
# Finally we copy the statically compiled Go binary.
COPY --from=builder /src/build/postcli /bin/
COPY --from=builder /src/build/libpost.so /bin/
ENTRYPOINT ["/bin/postcli"]