{"id":484,"date":"2024-10-27T14:53:30","date_gmt":"2024-10-27T06:53:30","guid":{"rendered":"http:\/\/www.chan.ink\/?p=484"},"modified":"2024-11-12T21:59:05","modified_gmt":"2024-11-12T13:59:05","slug":"docker%e5%9f%ba%e7%a1%80%e9%95%9c%e5%83%8f%e4%b9%8bcentos7-9-2009python3-9-5%e7%bb%84%e5%90%88","status":"publish","type":"post","link":"http:\/\/www.chan.ink\/index.php\/2024\/10\/27\/docker%e5%9f%ba%e7%a1%80%e9%95%9c%e5%83%8f%e4%b9%8bcentos7-9-2009python3-9-5%e7%bb%84%e5%90%88\/","title":{"rendered":"Docker\u57fa\u7840\u955c\u50cf\u4e4bCentos7.9.2009+python3.9.5\u7ec4\u5408"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">\u5982\u9898\uff1a<\/h1>\n\n\n\n<pre class=\"wp-block-code\"><code># Base images \u57fa\u7840\u955c\u50cf\nFROM centos:centos7.9.2009\n\n#MAINTAINER \u7ef4\u62a4\u8005\u4fe1\u606f\nLABEL maintainer chanjian6\n\n#RUN \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\nRUN rm -f \/etc\/yum.repos.d\/*.repo\nRUN curl -o \/etc\/yum.repos.d\/CentOS-Base.repo https:\/\/mirrors.aliyun.com\/repo\/Centos-7.repo\n\n# GCC\u7f16\u8bd1\u5668\nRUN yum install gcc -y\n\n# Python\u4f9d\u8d56\nRUN yum install -y zlib zlib-devel bzip2 bzip2-devel ncurses ncurses-devel readline readline-devel openssl openssl-devel  xz lzma xz-devel sqlite sqlite-devel gdbm gdbm-devel tk tk-devel  mysql-devel python-devel libffi-devel\n\n# wget\nRUN yum install wget -y\n\n# \u76ee\u5f55\u521d\u59cb\u5316\nRUN mkdir -p \/www\/\nWORKDIR \/www\/\n\n# SQLite\u5347\u7ea7\nRUN wget https:\/\/www.sqlite.org\/2023\/sqlite-autoconf-3420000.tar.gz  --no-check-certificate\nRUN tar -zxvf sqlite-autoconf-3420000.tar.gz\nWORKDIR \/www\/sqlite-autoconf-3420000\nRUN .\/configure\nRUN make &amp;&amp; make install\nENV LD_LIBRARY_PATH=\"\/usr\/local\/lib\"\nRUN rm -rf \/www\/sqlite-autoconf-3420000*\n\n# Python3.9\u73af\u5883\nWORKDIR \/www\/\nRUN wget https:\/\/www.python.org\/ftp\/python\/3.9.5\/Python-3.9.5.tgz\nRUN tar -xvf Python-3.9.5.tgz\nWORKDIR \/www\/Python-3.9.5\/\nRUN .\/configure\nRUN make &amp;&amp; make install\nRUN rm -rf \/www\/Python-3.9.5\n\nRUN pip3.9 config set global.index-url https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u9898\uff1a<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-484","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/484","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/comments?post=484"}],"version-history":[{"count":2,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/484\/revisions"}],"predecessor-version":[{"id":561,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/484\/revisions\/561"}],"wp:attachment":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/media?parent=484"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/categories?post=484"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/tags?post=484"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}