-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
77 lines (55 loc) Β· 2.28 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM ubuntu:22.10
RUN apt update && apt upgrade -y
# Configure stuff at root.
RUN cd /
# -----------------------------------------------------------------------------
# Get development dependencies.
# -----------------------------------------------------------------------------
# Get flutter dependencies.
RUN apt install zip xz-utils curl libglu1-mesa git -y
# Get flutter linux toolchain dependencies.
RUN apt install clang cmake ninja-build pkg-config libgtk-3-dev -y
# Get flutter.
RUN git clone -b master https://github.com/flutter/flutter.git
ENV PATH="/flutter/bin:${PATH}"
RUN flutter precache --no-universal --linux & flutter doctor
# Get upx to reduce executable size.
# RUN apt install upx -y
# -----------------------------------------------------------------------------
# Get project dependencies.
# -----------------------------------------------------------------------------
# Get flutter runtime dependency.
RUN apt install libgtk-3-0
# Get osumffmpeg external dependencies.
RUN apt install ffmpeg -y
# -----------------------------------------------------------------------------
# Project build instructions.
# -----------------------------------------------------------------------------
# Copy source.
RUN mkdir osumffmpeg/
COPY . /osumffmpeg/
WORKDIR /osumffmpeg/
# Build linux executable.
RUN flutter create . --platforms=linux
RUN flutter build linux && cp -rf /osumffmpeg/build/linux/x64/release/bundle/* /bin/
# Reduce executable size via upx.
# RUN upx /osumffmpeg/build/linux/x64/release/bundle/lib/*
# -----------------------------------------------------------------------------
# Clean up everything.
# -----------------------------------------------------------------------------
# Remove development dependencies.
RUN apt remove zip xz-utils curl libglu1-mesa git -y
RUN apt remove clang cmake ninja-build pkg-config libgtk-3-dev -y
# Remove upx used for reducing executable size.
# RUN apt remove upx -y
# Remove flutter.
RUN rm -rf /flutter/
# Remove source code.
RUN rm -rf /osumffmpeg/
# Remove unused packages.
RUN apt autoremove --purge -y && apt clean -y
# -----------------------------------------------------------------------------
# Entry point.
# -----------------------------------------------------------------------------
# Start Osumffmpeg.
CMD ["osumffmpeg"]