public void PushPlatformImage(string platform)
        {
            string arguments = $"push {DockerConstants.GetPlatformImageName( platform )}";
            ProcessArgumentBuilder argumentsBuilder = ProcessArgumentBuilder.FromString(arguments);
            ProcessSettings        settings         = new ProcessSettings
            {
                Arguments = argumentsBuilder
            };

            int exitCode = context.StartProcess("docker", settings);

            if (exitCode != 0)
            {
                throw new ApplicationException(
                          $"Error when trying to push docker platform image {platform}.  Got error: " + exitCode
                          );
            }
        }
예제 #2
0
        public void BuildPlatformImage(string platform)
        {
            FilePath dockerFile = "server.dockerfile";

            string arguments = $"build --tag {DockerConstants.ImageName}:{MedituConstants.VersionString}_{platform} --file {dockerFile} .";
            ProcessArgumentBuilder argumentsBuilder = ProcessArgumentBuilder.FromString(arguments);
            ProcessSettings        settings         = new ProcessSettings
            {
                Arguments        = argumentsBuilder,
                WorkingDirectory = context.DockerPath
            };
            int exitCode = context.StartProcess("docker", settings);

            if (exitCode != 0)
            {
                throw new ApplicationException(
                          "Error when running docker to build.  Got error: " + exitCode
                          );
            }
        }