Showing posts with label Docker. Show all posts
Showing posts with label Docker. Show all posts

Login to Container in Kubernetes

Step 0

Get all pods

kubectl get po --all-namespaces

Find the pod name in which your container is running

Step 1

Get the container name from running pod

kubectl describe po pod_name --namespace my_namespace


Example output

Name: pod_name
Namespace: my_namespace
Node: docker-host-03/10.1.3.115
Start Time: Wed, 23 Nov 2016 16:57:15 +1100
Labels: name=my_container_name,pod-template-hash=2802333548
Status: Running
IP: 10.20.71.4


Note the label with value name

Step 2

Login to container

Example

kubectl exec -it pod_name --namespace my_namespace -c my_container_name bash

Remove Boot2docker from mac

Follow the steps below

Delete and stop boot2docker vms

$ VBoxManage list vms

It will show

"default" {7cc6538c-e5ac-447e-90ac-6cb043deffdd}
"boot2docker-vm" {ffff35a9-71ec-4e72-bf82-09f02c3949e2}

Delete the vm
$VBoxManage unregistervm default --delete
$VBoxManage unregistervm ffff35a9-71ec-4e72-bf82-09f02c3949e2 --delete

Verify again
$VBoxManage list vms

Delete and uninstall boot2docker by following steps

https://github.com/boot2docker/osx-installer/blob/master/uninstall.sh



Running Docker behind http proxy

Error message

dial tcp: lookup index.docker.io: no such host

HTTP Proxy
This example overrides the default docker.service file.

If you are behind a HTTP proxy server, for example in corporate settings, you will need to add this configuration in the Docker systemd service file.

First, create a systemd drop-in directory for the docker service:

mkdir /etc/systemd/system/docker.service.d
Now create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"

If you have internal Docker registries that you need to contact without proxying you can specify them via the NO_PROXY environment variable:

Environment="HTTP_PROXY=http://proxy.example.com:80/" "NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com"

Flush changes:
$ sudo systemctl daemon-reload
Restart Docker:
$ sudo systemctl restart docker