Operation | Command |
---|---|
View services | sudo systemctl list-unit-files –type=service |
Start | sudo systemctl start application.service sudo systemctl start application |
Stop | sudo systemctl stop application.service sudo systemctl stop application |
Restart | sudo systemctl restart application.service |
Reload | sudo systemctl reload application.service |
Enable/disable | sudo systemctl enable application.service |
Status | systemctl status application.service |
Tag Archives: CLI Reference
Vagrant CLI Reference
Note: You should use the commands in the same directory with the vagrant file.
Basic management
Description | Command |
---|---|
List of processes | vagrant global-status |
Create or start process | vagrant up |
Reconfigure existing process | vagrant provision |
Reboot process | vagrant reload |
Shutdown process | vagrant halt |
Connect via SSH | vagrant SSH |
Destroy the image | vagrant destroy |
Authoring commands
Description | Command |
---|---|
vagrant init | Create new vagrantfile |
vagrant share | Share the image |
vagrant snapshot push | Push a copy to the snapshot stack |
vagrant snapshot list | List stack contents |
vagrant snapshot restore ID | Restore a specific snapshot |
Run without environment variables
env -u GEM_HOME -u GEM_PATH vagrant
Docker CLI Reference
Reference
Command | Description |
---|---|
systemctl start docker systemctl status docker systemctl stop docker docker info docker version | start docker view docker process status stop docker view docker info view docker version |
docker images docker image ls docker search ubuntu docker pull ubuntu docker rmi ubuntu docker image rm | view image list view image list ( > v1.13) search for an image download an image delete an image delete an image ( > v1.13) |
docker ps -a docker ps -l docker container ls docker container rm <cid> docker rm <cid> | view running containers view all containers view containers ( > v1.13) delete container with id <cid> delete container with id <cid> |
docker run imagename docker run –name bla imagename docker run -it ubuntu docker start <cid> docker stop <cid> docker stop $(docker ps -q) docker stats <cid> docket top <cid> docker kill<cid> | create and run a container create and run a named container create interactive session start an existing container stop a container stop all running containers view running stats of a container view top stats of a container kill a running container |
docker attach <cid> docker exec -it ubuntu bash | reconnect to a running container Open a new terminal window |
How to detach
How container was started | how to detach |
---|---|
-t and -i is used to launch the container | ctrl + P and then ctrl + Q |
-t is used to launch the container | ctrl + C |
otherwise | pkiill |
Examples
sudo docker run --detach \ --hostname gitlab.example.com \ --publish 443:443 --publish 80:80 --publish 22:22 \ --name gitlab \ --restart always \ --volume /srv/gitlab/config:/etc/gitlab \ --volume /srv/gitlab/logs:/var/log/gitlab \ --volume /srv/gitlab/data:/var/opt/gitlab \ gitlab/gitlab-ce:latest
References: