我想减少 Dockerfile 中使用的层数。所以我想将COPY命令组合在一个RUN cp.
RUN cp我想使用单个命令组合以下命令
COPY ./dependencies/file1 /root/.m2
COPY ./dependencies/file2 /root/.sbt/
COPY ./dependencies/folder1 /root/.ivy2/cache
Run Code Online (Sandbox Code Playgroud)
以下命令显示“不存在此类文件或目录”错误。我哪里可能出错了?
RUN cp ./dependencies/file1 /root/.m2 && \
cp ./dependencies/file2 /root/.sbt/ && \
cp ./dependencies/folder1 /root/.ivy2/cache
Run Code Online (Sandbox Code Playgroud) 在数组中,我们可以执行int arr[100]={0}此操作
,这会将数组中的所有值初始化为0。我尝试使用vector like进行相同操作
vector <int> v(100)={0},但它给出了错误
error: expected ‘,’ or ‘;’ before ‘=’ token。另外,如果我们可以通过C ++的“ memset”功能执行此操作,请也告诉该解决方案。