{"id":68457,"date":"2026-11-19T12:15:00","date_gmt":"2026-11-19T04:15:00","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=68457"},"modified":"2026-11-15T14:01:12","modified_gmt":"2026-11-15T06:01:12","slug":"rental-q087-a","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/rental-q087-a\/","title":{"rendered":"Docker \u6216 Apptainer \u8dd1\u751f\u4fe1\u6d41\u7a0b\uff1a\u56fa\u5b9a\u955c\u50cf\u5e76\u6b63\u786e\u6302\u8f7d\u6570\u636e"},"content":{"rendered":"<p><!-- ysx-rental-campaign:rental-tutorials-400-20261114 article:rental_q087_a --><\/p>\n<div class=\"ysx-rental-tutorial\">\n<figure class=\"ysx-tutorial-figure\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/rental_q087_a-poster-1.png?resize=1200%2C720&#038;ssl=1\" alt=\"\u56fa\u5b9a\u5bb9\u5668\u955c\u50cf\u4e0e\u6302\u8f7d\uff1a\u8bb0\u5f55tag\u3001digest\u6216SIF\u6821\u9a8c\uff1b\u8f93\u5165\u53ea\u8bfb\uff0c\u5de5\u4f5c\u4e0e\u8f93\u51fa\u5206\u76d8\uff1b\u5728\u5bb9\u5668\u5185\u6838\u5bf9\u8def\u5f84\u548c\u6743\u9650\uff1b\u5c0f\u6837\u672c\u8dd1\u901a\u540e\u4fdd\u5b58\u65e5\u5fd7\" width=\"1200\" height=\"720\" loading=\"lazy\"><figcaption>\u672c\u6587\u64cd\u4f5c\u4e0e\u68c0\u67e5\u8def\u5f84\u793a\u610f\u3002<\/figcaption><\/figure>\n<p>\u5bb9\u5668\u80fd\u56fa\u5b9a\u8f6f\u4ef6\u548c\u4f9d\u8d56\u7248\u672c\uff0c\u4f46\u4e0d\u4f1a\u81ea\u52a8\u628a\u5bbf\u4e3b\u673a\u6570\u636e\u653e\u8fdb\u5bb9\u5668\uff0c\u4e5f\u4e0d\u4ee3\u8868\u7a0b\u5e8f\u5df2\u7ecf\u5177\u5907\u5408\u9002\u7684CPU\u3001\u5185\u5b58\u6216GPU\u989d\u5ea6\u3002\u8fd0\u884c\u751f\u4fe1\u6d41\u7a0b\u524d\uff0c\u5148\u56fa\u5b9a\u955c\u50cf\u7248\u672c\uff0c\u518d\u660e\u786e\u5bbf\u4e3b\u673a\u8f93\u5165\u3001\u4e34\u65f6\u76ee\u5f55\u548c\u8f93\u51fa\u5206\u522b\u6620\u5c04\u5230\u5bb9\u5668\u5185\u54ea\u91cc\uff0c\u5e76\u7528\u5c0f\u6837\u672c\u9a8c\u8bc1\u8bfb\u5199\u548c\u6743\u9650\u3002<\/p>\n<h2>\u56fa\u5b9a\u955c\u50cf\u8eab\u4efd\uff0c\u4e0d\u4f7f\u7528\u6f02\u79fb\u6807\u7b7e<\/h2>\n<p>\u955c\u50cf\u540d\u52a0<code>latest<\/code>\u53ef\u80fd\u968f\u65f6\u95f4\u53d8\u5316\u3002Docker\u6587\u6863\u652f\u6301\u6309tag\u6216\u5185\u5bb9digest\u5f15\u7528\u955c\u50cf\uff1b\u4e3a\u6b63\u5f0f\u8fd0\u884c\u8bb0\u5f55\u4ed3\u5e93\u3001tag\u3001digest\u3001\u62c9\u53d6\u65e5\u671f\u548c\u542f\u52a8\u547d\u4ee4\u3002Apptainer\u7684SIF\u6587\u4ef6\u4e5f\u5e94\u8bb0\u5f55\u6765\u6e90\u548cSHA256\u3002\u955c\u50cf\u56fa\u5b9a\u53ea\u63a7\u5236\u7528\u6237\u7a7a\u95f4\u73af\u5883\uff0c\u5bbf\u4e3b\u673a\u5185\u6838\u3001GPU\u9a71\u52a8\u3001\u6302\u8f7d\u76ee\u5f55\u548c\u8d44\u6e90\u9650\u5236\u4ecd\u9700\u53e6\u884c\u8bb0\u5f55\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u8def\u5f84<\/th>\n<th>\u5bb9\u5668\u5185\u7528\u9014<\/th>\n<th>\u5efa\u8bae\u6743\u9650<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\/project\/input<\/td>\n<td>\u539f\u59cbFASTQ\u3001FASTA\u6216\u53c2\u8003\u6587\u4ef6<\/td>\n<td>\u53ea\u8bfb<\/td>\n<\/tr>\n<tr>\n<td>\/project\/work<\/td>\n<td>\u4e34\u65f6\u6587\u4ef6\u3001\u6392\u5e8f\u7f13\u5b58\u3001\u7d22\u5f15<\/td>\n<td>\u8bfb\u5199\u5e76\u5355\u72ec\u4f30\u7b97\u7a7a\u95f4<\/td>\n<\/tr>\n<tr>\n<td>\/project\/output<\/td>\n<td>\u6700\u7ec8\u7ed3\u679c\u548c\u65e5\u5fd7<\/td>\n<td>\u8bfb\u5199\u3001\u72ec\u7acb\u76ee\u5f55<\/td>\n<\/tr>\n<tr>\n<td>\u5bb9\u5668\u5185\u90e8\u4e34\u65f6\u5c42<\/td>\n<td>\u4e34\u65f6\u8fd0\u884c\u4f46\u9000\u51fa\u540e\u53ef\u80fd\u6d88\u5931<\/td>\n<td>\u4e0d\u8981\u653e\u552f\u4e00\u7ed3\u679c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u660e\u786e\u6302\u8f7d\u5e76\u5148\u68c0\u67e5\u5bb9\u5668\u5185\u8def\u5f84<\/h2>\n<p>Docker\u4f7f\u7528bind mount\u5c06\u5bbf\u4e3b\u673a\u76ee\u5f55\u6620\u5c04\u5230\u5bb9\u5668\u8def\u5f84\u3002\u8f93\u5165\u53ef\u4ee5\u53ea\u8bfb\u6302\u8f7d\uff0c\u5de5\u4f5c\u76ee\u5f55\u548c\u8f93\u51fa\u5206\u522b\u6302\u8f7d\u3002\u4ee5Docker\u4e3a\u4f8b\uff0c\u66ff\u6362\u7ecf\u786e\u8ba4\u7684\u76ee\u5f55\u4e0e\u955c\u50cfdigest\uff1b\u5de5\u5177\u547d\u4ee4\u9700\u6362\u6210\u9879\u76ee\u5b9e\u9645\u5165\u53e3\u3002<\/p>\n<pre><code class=\"language-bash\">docker run --rm \\\n  --user \"$(id -u):$(id -g)\" \\\n  -v \/data\/project\/input:\/project\/input:ro \\\n  -v \/scratch\/job123\/work:\/project\/work:rw \\\n  -v \/results\/job123:\/project\/output:rw \\\n  -w \/project\/work \\\n  registry.example.org\/bio\/tool@sha256:REPLACE_WITH_VERIFIED_DIGEST \\\n  sh -lc 'test -r \/project\/input\/sample.fa &amp;&amp; touch \/project\/output\/.write-test &amp;&amp; my_tool --input \/project\/input\/sample.fa --output \/project\/output\/result'<\/code><\/pre>\n<p>\u5728\u771f\u5b9e\u4efb\u52a1\u524d\u5148\u8fd0\u884c\u53ea\u8bfb\u68c0\u67e5\u548c\u8f93\u51fa\u76ee\u5f55\u5199\u5165\u6d4b\u8bd5\uff0c\u786e\u8ba4\u8fd0\u884c\u7528\u6237\u7684UID\/GID\u5728\u5bbf\u4e3b\u673a\u6709\u76f8\u5e94\u6743\u9650\u3002\u4e0d\u8981\u901a\u8fc7\u5bb9\u5668\u5185root\u8eab\u4efd\u968f\u610f\u521b\u5efa\u6587\u4ef6\uff0c\u5426\u5219\u7ed3\u679c\u53ef\u80fd\u5f52\u5c5eroot\uff0c\u8bfe\u9898\u7ec4\u7528\u6237\u65e0\u6cd5\u8bfb\u53d6\u3002\u82e5\u76ee\u5f55\u5c5e\u4e8e\u7ec4\u5171\u4eab\uff0c\u6309\u7ba1\u7406\u5458\u7ea6\u5b9a\u8bbe\u7f6e\u7ec4\u6743\u9650\u548cumask\u3002\u9000\u51fa\u524d\u5220\u9664\u6d4b\u8bd5\u6587\u4ef6\uff0c\u771f\u6b63\u7ed3\u679c\u4fdd\u5b58\u5728\u5bbf\u4e3b\u673a\u6302\u8f7d\u7684\u8f93\u51fa\u76d8\u3002<\/p>\n<h2>Apptainer\u6302\u8f7d\u540c\u6837\u8981\u663e\u5f0f\u6838\u5bf9<\/h2>\n<p>\u5728\u96c6\u7fa4\u4e0a\u5e38\u7528Apptainer\/Singularity\u3002\u5b98\u65b9\u6587\u6863\u5141\u8bb8\u7528<code>--bind<\/code>\u6307\u5b9a\u6e90\u76ee\u5f55\u3001\u5bb9\u5668\u76ee\u6807\u8def\u5f84\u548c<code>ro\/rw<\/code>\u9009\u9879\uff0c\u4f46\u7ba1\u7406\u5458\u53ef\u7981\u7528\u7528\u6237\u81ea\u5b9a\u4e49\u6302\u8f7d\uff0c\u7cfb\u7edf\u4e5f\u53ef\u80fd\u81ea\u52a8\u6302\u8f7dhome\u548c\u5f53\u524d\u76ee\u5f55\u3002\u4e0d\u8981\u5047\u8bbe\u6587\u4ef6\u80fd\u88ab\u81ea\u52a8\u770b\u89c1\uff1b\u5728\u6267\u884c\u5206\u6790\u524d\u6253\u5370\u5bb9\u5668\u5185\u76ee\u5f55\u3001\u786e\u8ba4\u8f93\u5165\u6587\u4ef6\u5b58\u5728\u4e14\u8f93\u51fa\u8def\u5f84\u53ef\u5199\u3002<\/p>\n<pre><code class=\"language-bash\">apptainer exec \\\n  --bind \/data\/project\/input:\/project\/input:ro \\\n  --bind \/scratch\/job123\/work:\/project\/work:rw \\\n  --bind \/results\/job123:\/project\/output:rw \\\n  tool.sif sh -lc 'id; ls -l \/project\/input; touch \/project\/output\/.write-test'<\/code><\/pre>\n<h2>\u9a8c\u8bc1\u8d44\u6e90\u3001\u4e34\u65f6\u6587\u4ef6\u548c\u8f93\u51fa<\/h2>\n<p>\u7528\u5c0f\u6837\u672c\u5b8c\u6574\u8dd1\u4e00\u6b21\uff0c\u8bb0\u5f55\u9000\u51fa\u7801\u3001\u5bb9\u5668\u65e5\u5fd7\u3001\u955c\u50cf\u6458\u8981\u3001\u5bbf\u4e3b\u673a\u6302\u8f7d\u8def\u5f84\u3001\u5de5\u4f5c\u76ee\u5f55\u5cf0\u503c\u3001\u5185\u5b58\/CPU\u989d\u5ea6\u548c\u8f93\u51fa\u6e05\u5355\u3002\u8f93\u5165\u76ee\u5f55\u53ea\u8bfb\u53ef\u4ee5\u9632\u6b62\u8bef\u6539\u539f\u59cb\u6570\u636e\uff1b\u5de5\u4f5c\u76d8\u5e94\u6709\u8db3\u591f\u4e34\u65f6\u7a7a\u95f4\uff0c\u5c24\u5176\u662fBAM\u6392\u5e8f\u3001\u89e3\u538b\u548c\u6570\u636e\u5e93\u7d22\u5f15\u6b65\u9aa4\u3002\u82e5\u4e34\u65f6\u76ee\u5f55\u843d\u5230\u5bb9\u5668\u53ef\u5199\u5c42\uff0c\u9700\u786e\u8ba4\u5b83\u662f\u5426\u6709\u5bb9\u91cf\u9650\u5236\u53ca\u9000\u51fa\u540e\u7684\u4fdd\u5b58\u884c\u4e3a\u3002\u5bb9\u5668\u5185\u90e8\u5de5\u5177\u53ef\u89c1GPU\u4e0d\u7b49\u4e8eGPU\u8ba1\u7b97\u4e00\u5b9a\u88ab\u8c03\u7528\uff0c\u9700\u4f9d\u636e\u5de5\u5177\u65e5\u5fd7\u548c\u8fd0\u884c\u671f\u95f4\u76d1\u63a7\u68c0\u67e5\u3002<\/p>\n<p>\u4ea4\u4ed8\u65f6\u4fdd\u7559\u955c\u50cfdigest\u6216SIF\u6821\u9a8c\u503c\u3001\u6302\u8f7d\u6620\u5c04\u3001\u5b8c\u6574\u547d\u4ee4\u3001\u73af\u5883\u53d8\u91cf\u3001\u65e5\u5fd7\u3001\u8f93\u5165\u8f93\u51fa\u6821\u9a8c\u503c\u548c\u8d44\u6e90\u8bb0\u5f55\u3002\u5931\u8d25\u65f6\u5148\u533a\u5206\u955c\u50cf\/\u4f9d\u8d56\u9519\u8bef\u3001\u6302\u8f7d\u7f3a\u5931\u3001\u6743\u9650\u62d2\u7edd\u3001\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u548c\u8d44\u6e90\u8d85\u9650\uff0c\u518d\u6539\u5bf9\u5e94\u8bbe\u7f6e\u3002\u5bb9\u5668\u80fd\u590d\u73b0\u8f6f\u4ef6\u6808\uff0c\u4f46\u4ecd\u9700\u7ef4\u62a4\u6570\u636e\u6e05\u5355\u3001\u5206\u6790\u53c2\u6570\u548c\u53c2\u8003\u5e93\u7248\u672c\u3002<\/p>\n<h2>\u53c2\u8003\u8d44\u6599<\/h2>\n<ul>\n<li><a href=\"https:\/\/docs.docker.com\/engine\/containers\/run\/\">Docker\u8fd0\u884c\u5bb9\u5668\u3001\u955c\u50cf\u6807\u8bc6\u4e0ebind mount<\/a><\/li>\n<li><a href=\"https:\/\/apptainer.org\/docs\/user\/latest\/bind_paths_and_mounts.html\">Apptainer bind paths\u548c\u53ea\u8bfb\u6302\u8f7d<\/a><\/li>\n<li><a href=\"https:\/\/www.htslib.org\/doc\/samtools-sort.html\">samtools sort\u4e34\u65f6\u76ee\u5f55\u53c2\u6570<\/a><\/li>\n<\/ul>\n<section class=\"ysx-tutorial-downloads\">\n<h2>\u4e0b\u8f7d\u7ec3\u4e60\u6750\u6599<\/h2>\n<p><a href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/rental-tutorials-400\/rental_q087_a\/afd543cae22e5362d395\/rental_q087_a.pdf\" download>\u4e0b\u8f7d\u6559\u7a0b PDF<\/a> \u00b7 <a href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/rental-tutorials-400\/rental_q087_a\/9ca44a825202cda22551\/rental_q087_a.zip\" download>\u4e0b\u8f7d\u4ee3\u7801\u4e0e\u793a\u4f8b\u6570\u636e ZIP<\/a><\/p>\n<p>\u5148\u6838\u5bf9\u5305\u5185SHA256\u6e05\u5355\uff0c\u518d\u5728\u72ec\u7acb\u76ee\u5f55\u590d\u73b0\u3002<\/p>\n<\/section>\n<section class=\"ysx-rental-recommendation\">\n<h2>\u9700\u8981\u989d\u5916\u7b97\u529b\u65f6<\/h2>\n<p>\u9002\u7528\u524d\u63d0\uff1a\u5df2\u6709\u955c\u50cf\u6216\u53ef\u5bb9\u5668\u5316\u6d41\u7a0b\uff0c\u8fd0\u884c\u8d44\u6e90\u4e0d\u8db3\u3002\u5982\u9700\u989d\u5916\u8d44\u6e90\uff0c\u53ef\u8bc4\u4f30\u670d\u52a1\u5668\u79df\u8d41\u53ca\u6309\u9700\u73af\u5883\u90e8\u7f72\u3002\u54a8\u8be2\u65f6\u8bf4\u660e\u8f6f\u4ef6\u7248\u672c\u3001\u4efb\u52a1\u89c4\u6a21\u548c\u4f7f\u7528\u671f\u9650\uff0c\u914d\u7f6e\u4e0e\u652f\u6301\u8303\u56f4\u53e6\u884c\u786e\u8ba4\u3002<\/p>\n<details>\n<summary>\u54a8\u8be2\u672c\u4efb\u52a1\u7684\u670d\u52a1\u5668\u914d\u7f6e<\/summary>\n<p>    <section class=\"brtc-section\" id=\"rental-consultation\" aria-labelledby=\"brtc-title-68457\">\n    <h2 id=\"brtc-title-68457\">\u54a8\u8be2\u672c\u4efb\u52a1\u7684\u670d\u52a1\u5668\u914d\u7f6e<\/h2>\n    <p>\u7559\u4e0b\u624b\u673a\u53f7\uff0c\u6211\u4eec\u4f1a\u7ed3\u5408\u672c\u6587\u4efb\u52a1\u4e0e\u60a8\u6c9f\u901a\u670d\u52a1\u5668\u914d\u7f6e\u548c\u62a5\u4ef7\u3002<\/p>\n    <form class=\"brtc-form\" method=\"post\" action=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-admin\/admin-ajax.php\" data-article-key=\"rental_q087_a\">\n    <input type=\"hidden\" name=\"action\" value=\"brtc_submit\"><input type=\"hidden\" name=\"post_id\" value=\"68457\">\n    <input type=\"hidden\" name=\"article_key\" value=\"rental_q087_a\"><input type=\"hidden\" name=\"nonce\" value=\"9a07e39872\">\n    <input type=\"hidden\" name=\"request_id\" value=\"fcbd5a2d6eed385307204d57e5d93308\"><input type=\"hidden\" name=\"first_key\" value=\"rental_q087_a\">\n    <label>\u624b\u673a\u53f7<input name=\"phone\" type=\"tel\" inputmode=\"numeric\" autocomplete=\"tel-national\" minlength=\"11\" maxlength=\"11\" pattern=\"1[3-9][0-9]{9}\" required placeholder=\"\u8bf7\u8f93\u516511\u4f4d\u624b\u673a\u53f7\" title=\"\u8bf7\u8f93\u5165\u6709\u6548\u768411\u4f4d\u624b\u673a\u53f7\"><\/label>\n    <div class=\"brtc-honeypot\" aria-hidden=\"true\"><label>\u7f51\u7ad9<input name=\"website\" tabindex=\"-1\" autocomplete=\"off\"><\/label><\/div>\n    <label class=\"brtc-consent\"><input type=\"checkbox\" name=\"consent\" value=\"1\" required>\u6211\u540c\u610f\u901a\u8fc7\u6b64\u624b\u673a\u53f7\u8054\u7cfb\u6211\uff0c\u6c9f\u901a\u672c\u6b21\u670d\u52a1\u5668\u914d\u7f6e\u4e0e\u79df\u8d41\u9700\u6c42\u3002<\/label>\n    <button type=\"submit\">\u63d0\u4ea4\u54a8\u8be2<\/button><p class=\"brtc-status\" role=\"status\" aria-live=\"polite\"><\/p>\n    <\/form>\n    <p class=\"brtc-alternative\">\u4e5f\u53ef<a href=\"https:\/\/work.weixin.qq.com\/kfid\/kfcb05492f29d4d6064\" data-ysx-event=\"contact_click\">\u8054\u7cfb\u4e91\u751f\u4fe1\u4f01\u4e1a\u5fae\u4fe1\u5ba2\u670d<\/a>\uff0c\u8bf4\u660e\u672c\u6587\u4efb\u52a1\u3002<\/p>\n    <\/section>\n    <\/details>\n<\/section>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u7528\u955c\u50cf\u6458\u8981\u56fa\u5b9a\u8f6f\u4ef6\u73af\u5883\uff0c\u628a\u8f93\u5165\u53ea\u8bfb\u6302\u8f7d\u3001\u8f93\u51fa\u5355\u72ec\u6302\u8f7d\uff0c\u5e76\u9a8c\u8bc1\u5bb9\u5668\u5185\u6743\u9650\u548c\u7ed3\u679c\u8def\u5f84\u3002<\/p>\n","protected":false},"author":1,"featured_media":72558,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1,75],"tags":[721,156],"class_list":["post-68457","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-part","category-compute-environment","tag-721","tag-156"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/rental_q087_a-poster-1.png?fit=1200%2C720&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/comments?post=68457"}],"version-history":[{"count":3,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68457\/revisions"}],"predecessor-version":[{"id":72559,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68457\/revisions\/72559"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/72558"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=68457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=68457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=68457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}