-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
47 lines (37 loc) · 1.11 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
47
FROM ubuntu:22.04 as builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y --no-install-recommends \
locales \
ca-certificates \
git \
build-essential \
pkg-config \
cmake \
libfuse3-dev \
libwebsockets-dev \
libgtest-dev \
libgmock-dev \
clang-tidy \
valgrind
FROM builder as devcontainer
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ARG USERNAME=user
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME
RUN useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
FROM builder as buildrun
COPY . /src/webfuse
# workaround:
# remote build directory, since --exclude is not available yet
# .dockerignore is not suitable since we want build directory be present in DevContainer
RUN rm -rf /src/webfuse/build
WORKDIR /src/webfuse
RUN cmake -B build -DCMAKE_BUILD_TYPE=Release -DWITHOUT_TEST=ON -DWITHOUT_CLANG_TIDY=ON
RUN cmake --build build
RUN DESTDIR=out cmake --install build
FROM scratch as build
COPY --from=buildrun /src/webfuse/out /