Login/ssh to container:

docker exec -t -i mycontainer /bin/bash

Docker exec – run a command in a running container

-d, –detach Detached mode: run command in the background
–detach-keys string Override the key sequence for detaching a container
-e, –env list Set environment variables (default [])
–help Print usage
-i, –interactive Keep STDIN open even if not attached
–privileged Give extended privileges to the command
-t, –tty Allocate a pseudo-TTY
-u, –user string Username or UID (format: <name|uid>[:<group|gid>])


Push new image to registry

First save the new image by finding the container ID (using docker ps) and then committing it to a new image name. Note that only a-z0-9-_. are allowed when naming images:

$ docker commit containerID image-name


Now, push the image to the registry using the image ID. In this example the registry is on host named registry-host and listening on port 5000. To do this, tag the image with the host name or IP address, and the port of the registry:

$ docker tag image-name registry-host:5000/myadmin/rhel-httpd

$ docker push registry-host:5000/myadmin/rhel-httpd

Check that this worked by running:

$ docker images