Beispiel #1
0
        private static Docker Create()
        {
            var location = GetDockerLocation();

            if (location == null)
            {
                return(null);
            }

            var docker = new Docker(location);

            docker.RunCommand("info --format '{{.OSType}}'", "docker info", out var output);

            if (!string.Equals(output.Trim('\'', '"', '\r', '\n', ' '), "linux"))
            {
                Console.WriteLine($"'docker info' output: {output}");
                return(null);
            }

            return(docker);
        }
Beispiel #2
0
        private static Docker Create()
        {
            var location = GetDockerLocation();

            if (location == null)
            {
                return(null);
            }

            var docker = new Docker(location);

            // Windows docker must have Linux containers turned on, if they don't skip the docker tests
            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                docker.RunCommand("info --format '{{.OSType}}'", out var output);

                if (!string.Equals(output, "linux"))
                {
                    return(null);
                }
            }

            return(docker);
        }