English 中文(简体)
使用Docker多级建筑复制安装的包件有什么适当方法?
原标题:What s the proper way to use Docker multi-stage builds to copy a package installed with apt?

我有<条码>即速效植被——在我的制片人档案中安装了ffmpeg-no-install-recommends,并占用了一半以上的形象(500MB)。 我读到了其他地方,我可以尝试利用多层次建筑来缩小档案规模。

我应该这样做:

FROM node:20.9.0-slim
RUN apt-get -y update 
  && apt-get -y install ffmpeg --no-install-recommends 
  && apt-get clean

FROM node:20.9.0-slim
COPY --from=0 /usr/bin/ffmpeg
COPY --from=0 /usr/bin/ffplay
COPY --from=0 /usr/share/ffmpeg/ffprobe.xsd
COPY --from=0 /usr/share/lintian/overrides/ffmpeg

同上,第2页。 我应复制所有档案,或只读/usr/bin/ffeg? 如果我必须照抄所有文件,似乎就很容易打碎。

问题回答

除非你具体知道包裹中的个人档案是什么,他们做什么,以及为什么需要这些档案,否则你实际上能够得到的安装量要小于<条码>的速成装置——无全程/格式>。 在多阶段建设中,只有安装一揽子计划的一部分,你可以做一些可靠的trick子。

查阅Debian包装网页ffmpeg,该包装本身仅约2甲基溴。 人类网页通常被压制,但可能需要在<代码>/usr/comm/ffeg上填写半衰期文档。 最大的问题是:ffmpeg取决于9种不同的共享图书馆包,如果你不安装这些包裹,那么双筒大概会赢得笔迹:>>>>>:libavcodec59<<<>>>>>>_>_a>,它本身是 la(~14 MB),并且有许多属性;

多阶段建设的情况,如果你们需要某种工具来树立你们的形象,那么就能够有所帮助,但不一定需要这一工具来实际操作。 在诺德,如果你有C级延伸物的包件,你可能需要一名汇编员,但只能操作<代码>npm 。 (这在沙尔更为常见)。 在像Go这样的汇编语言中,你不需要汇编者来管理该方案,因此,你可以利用第一阶段的建设阶段来汇编申请,然后是第二阶段,仅复制所建应用程序,而不是制作工具。 由于在这一情况下,建筑系统由你控制,你可能知道所有必要的档案是什么,而且你可以确保你需要掌握最后形象的部件。





相关问题
Encode an Array of Images into a movie file? (iPhone)

My app takes time-lapse photos, and also records audio to go with it. The problem is, I have absolutely no idea how to go about turning it into a .mov/.mpeg file (I am new to this type of iPhone ...

How to use FFmpeg

I m trying to extract frames from a video and I ve picked ffmpeg ( tell me if you know something better ) for this task. I ve downloaded its source and don t know how to use it ?? how can I compile it?...

stitching videos together using ffmpeg on the command line

Does anybody know how to stitch two (or more) videos together using ffmpeg (or another cli)? This is assuming that all the videos are in the same format and the video format being used allows for ...

Using FFmpeg or wrapper to get mp3 from mp4 in C#

I m trying to extract an mp3 from a flash compatible mp4 file and have so far found FFMpeg and a bunch of different wrappers that all claim to be able to do the job. Ideally, I d like to not have to ...

Convert a video to MP4 (H.264/AAC) with ffmpeg

If I don t make a mistake, Safari currently need MP4 (H.264/AAC) video encoded for the HTML5 <video> element. So I tried to convert a video to this format with ffmpeg. However when I enter the ...

calculating filesize of a response?

im tryingto code a script to do dynamic transcoding of video and audio (likely just audio for now) and streaming to mobile devices, currently im using the script posted elsewhere on here (How do you ...

C# and FFmpeg preferably without shell commands?

I d like to be able to use FFmpeg to convert a video file from within my C# program. I know I can just call a shell command, but is there a better way? The issue with invoking a command via the ...

convert movie file to bitmap files with DirectShow

I want to convert movie files like AVI, MOV etc. to Bitmap-Files, like JPEG, JPEG2000, TIFF etc. Is it possible to realize that with DirectX / DirectShow? Is AVCodec from ffmpeg the much more better ...

热门标签