I hereby claim:
- I am rsercano on github.
- I am sercandrop (https://keybase.io/sercandrop) on keybase.
- I have a public key ASBt0ftWoFzNPEgrnYchicfwUzBXtLzAqQRblMp746dPMQo
To claim this, I am signing this object:
/* | |
* Copyright (c) 2018 Pierantonio Cangianiello | |
* | |
* MIT License | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
I hereby claim:
To claim this, I am signing this object:
As described on the Docker Machine SSH reference, the docker-machine
CLI invokes the standard OpenSSH client so we can use the common SSH tunneling syntax here. The following command will forward port 3000 from the default machine to localhost on your host computer's loopback interface. Using 0.0.0.0 as bind_address
will make it bind to all interfaces:
$ docker-machine ssh default -L 0.0.0.0:3000:localhost:3000
So, the container running at machine's port 3000 can be reached through localhost:3000
or any of your interfaces' IP (i.e. 192.168.1.10:3000
). That'd be useful to access your containerized services from other devices in your LAN.
mkdir .ssh
chmod 700 .ssh
cd .ssh
touch authorized_keys
chmod 600 authorized_keys
in local
#!/bin/bash | |
# Stop all containers | |
docker stop $(docker ps -a -q) | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) | |
# Delete all exited containers | |
sudo docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm | |
# Delete all unused images |