Skip to content

Instantly share code, notes, and snippets.

@marvell
Created May 18, 2015 15:29
Show Gist options
  • Save marvell/7c812736565928e602c4 to your computer and use it in GitHub Desktop.
Save marvell/7c812736565928e602c4 to your computer and use it in GitHub Desktop.
Remove APT cache (for Dockerfile)
apt-get clean autoclean
apt-get autoremove --yes
rm -rf /var/lib/{apt,dpkg,cache,log}/
@jsnfwlr
Copy link

jsnfwlr commented Mar 27, 2025

@valerio-bozzolan

  1. If you have an SSH server on your container, remove your SSH server ASAP. It is not needed to enter inside. That is a FAQ.

There are a number of containers that require allow ssh ingress to the container for legitimate reasons - gitea, gitlab, ssh tunnel deployments, etc

I think the better way to word what you're trying to say is:

If you need to access the shell within the container or execute arbitrary commands inside the container and can remote in to the host, it is advised that you run docker exec -it <container-name> <shell command> (example: docker exec -it traefik sh) from the host rather than install an SSH server in the container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment