<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>kkFileView &#8211; Lhy&#039;s blog</title>
	<atom:link href="https://blog.lhyshome.com/tag/kkfileview/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.lhyshome.com</link>
	<description>welcome</description>
	<lastBuildDate>Thu, 15 Aug 2024 03:00:56 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
<site xmlns="com-wordpress:feed-additions:1">219834889</site>	<item>
		<title>基于kkFileView的文件预览，docker部署</title>
		<link>https://blog.lhyshome.com/2024/08/15/209/</link>
					<comments>https://blog.lhyshome.com/2024/08/15/209/#respond</comments>
		
		<dc:creator><![CDATA[lhy]]></dc:creator>
		<pubDate>Thu, 15 Aug 2024 02:53:14 +0000</pubDate>
				<category><![CDATA[java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[小技巧]]></category>
		<category><![CDATA[脚本]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[kkFileView]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://blog.lhyshome.com/?p=209</guid>

					<description><![CDATA[下载 github下载地址：https://github.com/kekingcn/kkFileView 下载… <span class="read-more"><a href="https://blog.lhyshome.com/2024/08/15/209/">Read More &#187;</a></span>]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">下载</h2>



<p>github下载地址：<br>https://github.com/kekingcn/kkFileView</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="543" src="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-1024x543.png" alt="" class="wp-image-210" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-1024x543.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-300x159.png 300w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-768x407.png 768w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-1536x815.png 1536w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-500x265.png 500w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-800x424.png 800w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-1280x679.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1-660x350.png 660w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-1.png 1587w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>下载源码的zip包</p>



<h2 class="wp-block-heading">安装</h2>



<p>将下载的源码打开后，将源码docker路径下的文件夹上传至服务器</p>



<figure class="wp-block-image size-full"><img decoding="async" width="391" height="592" src="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-2.png" alt="" class="wp-image-211" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-2.png 391w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-2-198x300.png 198w" sizes="(max-width: 391px) 100vw, 391px" /></figure>



<p>在服务器执行docker build ../../Dockerfile 构建kkFileView的运行的基板</p>



<p>对源码 maven package后将server/target下的 kkFileView-4.4.0-beta.tar.gz 文件和根目录的Dockerfile（注意这里的Dockerfile和之前步骤的Dockerfile不是同一个，作用也不一样）上传至服务器</p>



<figure class="wp-block-image size-full"><img decoding="async" width="330" height="646" src="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-3.png" alt="" class="wp-image-212" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-3.png 330w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-3-153x300.png 153w" sizes="(max-width: 330px) 100vw, 330px" /></figure>



<p>修改Dockerfile中的 ADD ./kkFileView-4.4.0-beta.tar.gz /opt/ 这一行  将kkFileView-4.4.0-beta.tar.gz的路径改为服务器上对应的 绝对路径或者相对路径，对当前DockerFile执行docker build ，构建完成后将会出现kkFileView的执行docker镜像</p>



<p>用docker run启动当前镜像 暴露8012端口到宿主机</p>



<p>在服务器防火墙上对8012端口放行</p>



<h2 class="wp-block-heading">验证</h2>



<p>http://服务器ip:8012</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="596" src="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-1024x596.png" alt="" class="wp-image-213" srcset="https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-1024x596.png 1024w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-300x175.png 300w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-768x447.png 768w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-500x291.png 500w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-800x466.png 800w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-1280x745.png 1280w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4-660x384.png 660w, https://blog.lhyshome.com/wp-content/uploads/2024/08/image-4.png 1522w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>出现这个页面则为部署成功</p>



<p>http://服务器ip:8012/onlinePreview?url=aHR0cDovLzE5Mi4xNjguMC4yMDA6NTI0NC9wL0Rvd25sb2Fkcy8lRTYlOTYlQjAlRTUlQkIlQkElRTYlOTYlODclRTYlQTElQTMuZG9jeD9zaWduPW53RHB2MVhoS2NXQ3pPODVfa2tPbE85MFo1NGp2YnNXdXA0VlRacnlmaUU9OjA%3D</p>



<p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">注意http://服务器ip:8012/onlinePreview?url= 后拼接的地址为文件下载地址，且必须经过base64编码后的请求地址</mark></p>



<h2 class="wp-block-heading">官方操作文档</h2>



<p>https://kkfileview.keking.cn</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.lhyshome.com/2024/08/15/209/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">209</post-id>	</item>
	</channel>
</rss>
