|
|
|
|
@ -1,55 +1,56 @@
|
|
|
|
|
#Region "Microsoft.VisualBasic::2bc4c7a574db43f6df5da77e267ee513, CloudKit\Docker\Environment.vb"
|
|
|
|
|
|
|
|
|
|
' Author:
|
|
|
|
|
'
|
|
|
|
|
' asuka (amethyst.asuka@gcmodeller.org)
|
|
|
|
|
' xie (genetics@smrucc.org)
|
|
|
|
|
' xieguigang (xie.guigang@live.com)
|
|
|
|
|
'
|
|
|
|
|
' Copyright (c) 2018 GPL3 Licensed
|
|
|
|
|
'
|
|
|
|
|
'
|
|
|
|
|
' GNU GENERAL PUBLIC LICENSE (GPL3)
|
|
|
|
|
'
|
|
|
|
|
'
|
|
|
|
|
' This program is free software: you can redistribute it and/or modify
|
|
|
|
|
' it under the terms of the GNU General Public License as published by
|
|
|
|
|
' the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
' (at your option) any later version.
|
|
|
|
|
'
|
|
|
|
|
' This program is distributed in the hope that it will be useful,
|
|
|
|
|
' but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
' GNU General Public License for more details.
|
|
|
|
|
'
|
|
|
|
|
' You should have received a copy of the GNU General Public License
|
|
|
|
|
' along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
' Author:
|
|
|
|
|
'
|
|
|
|
|
' asuka (amethyst.asuka@gcmodeller.org)
|
|
|
|
|
' xie (genetics@smrucc.org)
|
|
|
|
|
' xieguigang (xie.guigang@live.com)
|
|
|
|
|
'
|
|
|
|
|
' Copyright (c) 2018 GPL3 Licensed
|
|
|
|
|
'
|
|
|
|
|
'
|
|
|
|
|
' GNU GENERAL PUBLIC LICENSE (GPL3)
|
|
|
|
|
'
|
|
|
|
|
'
|
|
|
|
|
' This program is free software: you can redistribute it and/or modify
|
|
|
|
|
' it under the terms of the GNU General Public License as published by
|
|
|
|
|
' the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
' (at your option) any later version.
|
|
|
|
|
'
|
|
|
|
|
' This program is distributed in the hope that it will be useful,
|
|
|
|
|
' but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
' GNU General Public License for more details.
|
|
|
|
|
'
|
|
|
|
|
' You should have received a copy of the GNU General Public License
|
|
|
|
|
' along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
' /********************************************************************************/
|
|
|
|
|
' /********************************************************************************/
|
|
|
|
|
|
|
|
|
|
' Summaries:
|
|
|
|
|
' Summaries:
|
|
|
|
|
|
|
|
|
|
' Class Environment
|
|
|
|
|
'
|
|
|
|
|
' Properties: [Shared], container
|
|
|
|
|
'
|
|
|
|
|
' Constructor: (+1 Overloads) Sub New
|
|
|
|
|
' Function: CreateDockerCommand, (+2 Overloads) Mount
|
|
|
|
|
'
|
|
|
|
|
' Class DockerAppDriver
|
|
|
|
|
'
|
|
|
|
|
' Constructor: (+1 Overloads) Sub New
|
|
|
|
|
' Function: Shell
|
|
|
|
|
'
|
|
|
|
|
' /********************************************************************************/
|
|
|
|
|
' Class Environment
|
|
|
|
|
'
|
|
|
|
|
' Properties: [Shared], container
|
|
|
|
|
'
|
|
|
|
|
' Constructor: (+1 Overloads) Sub New
|
|
|
|
|
' Function: CreateDockerCommand, (+2 Overloads) Mount
|
|
|
|
|
'
|
|
|
|
|
' Class DockerAppDriver
|
|
|
|
|
'
|
|
|
|
|
' Constructor: (+1 Overloads) Sub New
|
|
|
|
|
' Function: Shell
|
|
|
|
|
'
|
|
|
|
|
' /********************************************************************************/
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
Imports System.Runtime.CompilerServices
|
|
|
|
|
Imports System.Text
|
|
|
|
|
Imports Darwinism.Docker.Arguments
|
|
|
|
|
Imports Microsoft.VisualBasic.CommandLine
|
|
|
|
|
Imports Microsoft.VisualBasic.Linq
|
|
|
|
|
|
|
|
|
|
''' <summary>
|
|
|
|
|
@ -249,7 +250,7 @@ Public Class Environment
|
|
|
|
|
Call options.AppendLine($"-p {portForward}")
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
Return $"docker run {options} {container} {command}"
|
|
|
|
|
Return $"run {options} {container} {command}"
|
|
|
|
|
End Function
|
|
|
|
|
End Class
|
|
|
|
|
|
|
|
|
|
@ -259,7 +260,6 @@ End Class
|
|
|
|
|
Public Class DockerAppDriver
|
|
|
|
|
|
|
|
|
|
ReadOnly docker As Environment
|
|
|
|
|
ReadOnly powershell As New PowerShell
|
|
|
|
|
ReadOnly appHome$
|
|
|
|
|
ReadOnly appName$
|
|
|
|
|
|
|
|
|
|
@ -278,6 +278,6 @@ Public Class DockerAppDriver
|
|
|
|
|
|
|
|
|
|
<MethodImpl(MethodImplOptions.AggressiveInlining)>
|
|
|
|
|
Public Function Shell(args$, Optional workdir$ = Nothing) As String
|
|
|
|
|
Return powershell(docker.CreateDockerCommand($"{appHome}/{appName} {args}", workdir:=workdir))
|
|
|
|
|
Return Commands.shell("docker", docker.CreateDockerCommand($"{appHome}/{appName} {args}", workdir:=workdir))
|
|
|
|
|
End Function
|
|
|
|
|
End Class
|
|
|
|
|
|