Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何从DockerFile方法为DockerDotNet BuildImageFromDockerfile创建流?_C#_Docker - Fatal编程技术网

C# 如何从DockerFile方法为DockerDotNet BuildImageFromDockerfile创建流?

C# 如何从DockerFile方法为DockerDotNet BuildImageFromDockerfile创建流?,c#,docker,C#,Docker,我正在尝试使用库构建Docker映像: Dockerfile: #using ubuntu as having trouble with ssl on debian FROM ubuntu:14.04 #install php RUN apt-get update && apt-get install -y php5-cli #copy crontab, php script and data files container COPY my-crontab / COPY ge

我正在尝试使用库构建Docker映像:

Dockerfile:

#using ubuntu as having trouble with ssl on debian
FROM ubuntu:14.04

#install php
RUN apt-get update && apt-get install -y php5-cli

#copy crontab, php script and data files container
COPY my-crontab /
COPY getData.php /
COPY saveddata.xml /

#run crontab
RUN crontab /my-crontab
ENTRYPOINT cron -f

我通过将文件逐个添加到tar归档文件中,而不是一次归档整个目录,成功地创建了一个映像。但是,生成的映像只是基本的Ubuntu映像,而不是Dockerfile中指定的映像。我已复制了问题中的Dockerfile。请查看此问题以了解我如何解决此问题:我已通过将文件逐个添加到tar存档中来创建映像,而不是一次性存档整个目录。但是,生成的映像只是基本的Ubuntu映像,而不是Dockerfile中指定的映像。我已复制了问题中的Dockerfile。有关我如何解决此问题,请参见此问题:
       var parameters = new BuildImageFromDockerfileParameters
        {
            RepositoryTagName = "test-image",
            RemoveIntermediateContainers = true
        };

        using (var fileStream = new FileStream(@"C:\temp\Dockerfile.tar.gz",FileMode.Open))
        {
            await client.Miscellaneous.BuildImageFromDockerfileAsync(fileStream, parameters, new CancellationToken());
        }
#using ubuntu as having trouble with ssl on debian
FROM ubuntu:14.04

#install php
RUN apt-get update && apt-get install -y php5-cli

#copy crontab, php script and data files container
COPY my-crontab /
COPY getData.php /
COPY saveddata.xml /

#run crontab
RUN crontab /my-crontab
ENTRYPOINT cron -f