@echo off echo --------------------------------�Զ������������ǰ���޸�-------------------------------------- set jarName=op-modules-sap.jar set profile=dev set imageURI=192.168.202.36:30002/op-lanju/op-sap rem echo ��ȡ��ǰ�����ַ��� for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c rem echo ��ȡ��ǰʱ���ַ��� for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b rem echo �統ǰСʱС��10�����ո��滻Ϊ0 set T=%T: =0% rem echo ��ʾ�������ʱ���ַ��� set imageVersion=%D%%T% ::���������Ϣ echo jar������:%jarName% echo ��������:%profile% echo ������ַ:%imageURI% echo ����汾:%imageVersion% echo --------------------------------mvn package...-------------------------------- ::call mvn clean package -Dmaven.test.skip=true copy .\libsapjco3.so .\target\libsapjco3.so cd .\target SET df=Dockerfile if exist %df% ( del /f /s /q .\Dockerfile ) echo --------------------------------����Dockerfile-------------------------------- echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile echo ADD libsapjco3.so /usr/lib/libsapjco3.so >> Dockerfile echo RUN chmod a+x -R /usr/lib/libsapjco3.so >> Dockerfile echo ENV LD_LIBRARY_PATH /usr/lib >> Dockerfile echo COPY %jarName% /application.jar >> Dockerfile echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile dir echo --------------------------------docker login...------------------------------- docker login 192.168.202.36:30002 -u admin -p Harbor@2023 echo --------------------------------docker build...------------------------------- docker build -t %imageURI%:%imageVersion% . echo --------------------------------docker push...-------------------------------- docker push %imageURI%:%imageVersion% @pause