mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-14 10:36:30 +08:00
feat: 容器创建支持特权模式 (#3021)
This commit is contained in:
parent
a5a707b923
commit
7972de5f33
7 changed files with 16 additions and 0 deletions
|
@ -52,6 +52,7 @@ type ContainerOperate struct {
|
|||
CPUShares int64 `json:"cpuShares"`
|
||||
NanoCPUs float64 `json:"nanoCPUs"`
|
||||
Memory float64 `json:"memory"`
|
||||
Privileged bool `json:"privileged"`
|
||||
AutoRemove bool `json:"autoRemove"`
|
||||
Volumes []VolumeHelper `json:"volumes"`
|
||||
Labels []string `json:"labels"`
|
||||
|
|
|
@ -937,6 +937,7 @@ func loadConfigInfo(isCreate bool, req dto.ContainerOperate, oldContainer *types
|
|||
networkConf = network.NetworkingConfig{}
|
||||
}
|
||||
|
||||
hostConf.Privileged = req.Privileged
|
||||
hostConf.AutoRemove = req.AutoRemove
|
||||
hostConf.CPUShares = req.CPUShares
|
||||
hostConf.PublishAllPorts = req.PublishAllPorts
|
||||
|
|
|
@ -40,6 +40,7 @@ export namespace Container {
|
|||
cpuShares: number;
|
||||
memory: number;
|
||||
volumes: Array<Volume>;
|
||||
privileged: boolean;
|
||||
autoRemove: boolean;
|
||||
labels: Array<string>;
|
||||
labelsStr: string;
|
||||
|
|
|
@ -576,6 +576,9 @@ const message = {
|
|||
custom: 'Custom',
|
||||
emptyUser: 'When empty, you will log in as default',
|
||||
containerTerminal: 'Terminal',
|
||||
privileged: 'Privileged',
|
||||
privilegedHelper:
|
||||
'Allows the container to perform certain privileged operations on the host, which may increase container risks. Use with caution!',
|
||||
|
||||
upgradeHelper: 'This operation only supports upgrading container versions.',
|
||||
ignoreCompare: 'Force Upgrade',
|
||||
|
|
|
@ -560,6 +560,8 @@ const message = {
|
|||
custom: '自定義',
|
||||
containerTerminal: '終端',
|
||||
emptyUser: '為空時,將使用容器默認的用戶登錄',
|
||||
privileged: '特權模式',
|
||||
privilegedHelper: '允許容器在主機上執行某些特權操作,可能會增加容器風險,請謹慎開啟!',
|
||||
|
||||
upgradeHelper: '該操作僅支持容器版本升級',
|
||||
ignoreCompare: '強製升級',
|
||||
|
|
|
@ -561,6 +561,8 @@ const message = {
|
|||
custom: '自定义',
|
||||
containerTerminal: '终端',
|
||||
emptyUser: '为空时,将使用容器默认的用户登录',
|
||||
privileged: '特权模式',
|
||||
privilegedHelper: '允许容器在主机上执行某些特权操作,可能会增加容器风险,谨慎开启!',
|
||||
|
||||
upgradeHelper: '该操作仅支持容器版本升级',
|
||||
ignoreCompare: '强制升级',
|
||||
|
|
|
@ -184,6 +184,12 @@
|
|||
{{ $t('container.autoRemove') }}
|
||||
</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('container.privileged')">
|
||||
<el-checkbox v-model="dialogData.rowData!.privileged">
|
||||
{{ $t('commons.button.start') }}
|
||||
</el-checkbox>
|
||||
<span class="input-help">{{ $t('container.privilegedHelper') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('container.console')">
|
||||
<el-checkbox v-model="dialogData.rowData!.tty">{{ $t('container.tty') }}</el-checkbox>
|
||||
<el-checkbox v-model="dialogData.rowData!.openStdin">
|
||||
|
|
Loading…
Add table
Reference in a new issue