77 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			77 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
FROM ubuntu:20.04
 | 
						|
 | 
						|
# Installing dependencies
 | 
						|
RUN apt update
 | 
						|
 | 
						|
RUN DEBIAN_FRONTEND=noninteractive apt install -y qtbase5-dev openssl libmbedtls-dev tesseract-ocr tesseract-ocr-rus libopencv-dev libzbar-dev qttools5-dev nlohmann-json3-dev libcurl4-openssl-dev libtesseract-dev libqrencode-dev
 | 
						|
RUN DEBIAN_FRONTEND=noninteractive apt install -y wget git cmake make gcc g++ fuse
 | 
						|
 | 
						|
# For gcc 12
 | 
						|
RUN DEBIAN_FRONTEND=noninteractive apt install -y libmpc-dev libmpfr-dev libgmp-dev
 | 
						|
 | 
						|
# The program uses std::regex_constants::multiline and some other C++17 things that are not found in gcc for Ubuntu Focal. Thus, we should compile it.
 | 
						|
 | 
						|
WORKDIR /
 | 
						|
 | 
						|
RUN wget https://mirror.linux-ia64.org/gnu/gcc/releases/gcc-12.3.0/gcc-12.3.0.tar.gz
 | 
						|
RUN tar xf gcc-12.3.0.tar.gz
 | 
						|
 | 
						|
RUN rm gcc-12.3.0.tar.gz
 | 
						|
 | 
						|
WORKDIR /gcc-12.3.0
 | 
						|
RUN ./configure --disable-multilib --prefix=/usr
 | 
						|
RUN make -j $(nproc) && make install
 | 
						|
 | 
						|
RUN cp /lib64/* /lib/x86_64-linux-gnu || :
 | 
						|
 | 
						|
WORKDIR /
 | 
						|
RUN rm -rf gcc-12.3.0
 | 
						|
 | 
						|
# Download linuxdeployqt
 | 
						|
RUN wget https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage -O /usr/bin/linuxdeployqt && \
 | 
						|
    chmod +x /usr/bin/linuxdeployqt
 | 
						|
 | 
						|
# Prepare AppDir and its files
 | 
						|
WORKDIR /appimage
 | 
						|
RUN mkdir -p AppDir
 | 
						|
 | 
						|
COPY deploy/appimage/checks-parser.desktop AppDir
 | 
						|
COPY assets/icons/icon.png AppDir/checks-parser.png
 | 
						|
COPY deploy/appimage/AppRun AppDir
 | 
						|
RUN chmod +x AppDir/AppRun
 | 
						|
 | 
						|
#Copy only necessities
 | 
						|
COPY assets ./assets
 | 
						|
COPY check ./check
 | 
						|
COPY exceptions ./exceptions
 | 
						|
COPY goods ./goods
 | 
						|
COPY image ./image
 | 
						|
COPY image_redactor ./image_redactor
 | 
						|
COPY output ./output
 | 
						|
COPY parser ./parser
 | 
						|
COPY settings ./settings
 | 
						|
COPY scenes ./scenes
 | 
						|
COPY net ./net
 | 
						|
COPY translations ./translations
 | 
						|
COPY utils ./utils
 | 
						|
 | 
						|
COPY ./*cpp ./*.h ./*.ui ./*.qrc CMakeLists.txt .
 | 
						|
 | 
						|
RUN mkdir build
 | 
						|
WORKDIR /appimage/build
 | 
						|
 | 
						|
RUN cmake -DBUILD_TRANSLATIONS=on .. && make -j 8
 | 
						|
 | 
						|
WORKDIR /appimage/AppDir/usr/bin
 | 
						|
 | 
						|
RUN cp /appimage/build/checks-parser .
 | 
						|
 | 
						|
WORKDIR /appimage
 | 
						|
 | 
						|
RUN linuxdeployqt --appimage-extract-and-run AppDir/usr/bin/checks-parser -no-copy-copyright-files -appimage
 | 
						|
 | 
						|
RUN mkdir -p /appimage/output
 | 
						|
RUN cp Checks_parser-x86_64.AppImage /appimage/output
 | 
						|
 | 
						|
ENTRYPOINT bash
 |