feat(container-creation): support auto remove option (docker run --rm) (#2684)

pull/2745/head
linquize 2019-02-25 04:48:31 +08:00 committed by Anthony Lapenna
parent d5dfc889bb
commit 99e50370bd
2 changed files with 12 additions and 0 deletions

View File

@ -50,6 +50,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
PortBindings: [], PortBindings: [],
PublishAllPorts: false, PublishAllPorts: false,
Binds: [], Binds: [],
AutoRemove: false,
NetworkMode: 'bridge', NetworkMode: 'bridge',
Privileged: false, Privileged: false,
Runtime: '', Runtime: '',

View File

@ -125,6 +125,17 @@
Actions Actions
</div> </div>
<div class="form-group"> <div class="form-group">
<!-- autoremove -->
<div class="col-sm-12">
<label for="ownership" class="control-label text-left">
Auto remove
<portainer-tooltip position="bottom" message="When enabled, Portainer will automatically remove the container when it exits. This is useful when you want to use the container only once."></portainer-tooltip>
</label>
<label class="switch" style="margin-left: 20px;">
<input type="checkbox" ng-model="config.HostConfig.AutoRemove"><i></i>
</label>
</div>
<!-- !autoremove -->
<div class="col-sm-12"> <div class="col-sm-12">
<button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !config.Image || (!formValues.Registry && fromContainer)" ng-click="create()" button-spinner="state.actionInProgress"> <button type="button" class="btn btn-primary btn-sm" ng-disabled="state.actionInProgress || !config.Image || (!formValues.Registry && fromContainer)" ng-click="create()" button-spinner="state.actionInProgress">
<span ng-hide="state.actionInProgress">Deploy the container</span> <span ng-hide="state.actionInProgress">Deploy the container</span>