-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
145 lines (115 loc) · 4.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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# defaul TAG is dev
ARG TAG=dev
# Default release is 18.04
ARG BASE_IMAGE_RELEASE=22.04
# Default base image
ARG BASE_IMAGE=ubuntu:22.04
# --- BEGIN node_modules_builder ---
FROM $BASE_IMAGE as node_modules_builder
#Install curl
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
gnupg \
gpg-agent \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV NODE_MAJOR=18
# install yarn npm nodejs
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && apt-get update && apt-get install -y --no-install-recommends nodejs && npm -g install yarn
COPY composer /composer
# Add nodejs service
WORKDIR /composer/node/common-libraries
RUN yarn install --production=true
WORKDIR /composer/node/file-service
RUN yarn install --production=true
WORKDIR /composer/node/printer-service
RUN yarn install --production=true
# --- START Build image ---
FROM $BASE_IMAGE
# define arg
# ARG ABCDESKTOP_LOCALACCOUNT_DIR
ARG TARGET_MODE
# convert ARG to ENV with same name
#ENV ABCDESKTOP_LOCALACCOUNT_DIR=$ABCDESKTOP_LOCALACCOUNT_DIR
ENV NODE_MAJOR=18
# Add LABELS
LABEL MAINTAINER="Alexandre DEVELY"
LABEL vcs-type "git"
LABEL vcs-url "https://github.com/abcdesktopio/oc.cupsd"
LABEL vcs-ref "3.2"
# define env
ENV DEBCONF_FRONTEND noninteractive
ENV TERM linux
##
# install fonts
RUN apt-get update && apt-get install -y --no-install-recommends \
xfonts-base \
xfonts-encodings \
xfonts-utils \
xfonts-100dpi \
xfonts-75dpi \
xfonts-cyrillic \
ubuntustudio-fonts \
libfontconfig \
libfreetype6 \
fonts-freefont-ttf \
fonts-croscore \
fonts-dejavu-core \
fonts-horai-umefont \
fonts-noto \
fonts-opendyslexic \
fonts-roboto \
fonts-roboto-hinted \
fonts-sil-mondulkiri \
fonts-unfonts-core \
fonts-wqy-microhei \
fonts-ipafont-gothic \
fonts-wqy-zenhei \
fonts-tlwg-loma-otf \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# cups-pdf: pdf printer support
# smbclient: need to install smb printer
# cups: printer support
RUN apt-get update && apt-get install -y --no-install-recommends \
smbclient \
cups-pdf \
cups \
&& apt-get clean\
&& rm -rf /var/lib/apt/lists/*
# apt install iproute2 install ip command
# install supervisor
RUN apt-get update && apt-get install -y --no-install-recommends \
supervisor \
curl \
gpg-agent \
software-properties-common \
gnupg \
curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# install yarn npm nodejs
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && apt-get update && apt-get install -y --no-install-recommends nodejs
# copy js source code and modules
COPY --from=node_modules_builder /composer /composer
COPY docker-entrypoint.sh /docker-entrypoint.sh
# Add root to lpadmin
RUN adduser root lpadmin
RUN echo `date` > /etc/build.date
# LOG AND PID SECTION
RUN mkdir -p /var/log/desktop \
/var/run/desktop \
/composer/run
COPY etc /etc
RUN chown -R lp:root /etc/cups/ppd /etc/cups/printers.conf
USER root
CMD /docker-entrypoint.sh
# DEFAULT FILE_SERVICE_TCP_PORT has changed for printer
# FILE_SERVICE_TCP_PORT 29782
# expose cupsd tcp port
EXPOSE 631 29782