Ejemplo n.º 1
0
        public MySqlContainer()
        {
            var externalPort = 3306;

            DockerRunParams parameters = new DockerRunParams()
                                         .AddParam($"-p {externalPort}:3306")
                                         .AddParam($"--env MYSQL_ROOT_PASSWORD=sa")
                                         .AddParam($"--env MYSQL_DATABASE=Test")
                                         .AddParam("-d")
                                         .AddParam($"mysql");

            _container = new DockerContainer(parameters);
        }
Ejemplo n.º 2
0
        public DockerContainer(DockerRunParams parameters)
        {
            Parameters        = parameters;
            _containerId      = string.Empty;
            _dockerExecutable = GetPath("docker.exe");
            var arguments = parameters.Get();

            _processInfo = new ProcessStartInfo(_dockerExecutable, arguments)
            {
                RedirectStandardOutput = true,
                UseShellExecute        = false,
                CreateNoWindow         = true
            };
        }