Contents

Introduction

Prerequisites

Requirements

Components Used

Background Information

Problem

Solution

Introduction

This document describes how to troubleshoot a docker container behind a proxy server when it is unable to access the Internet.

Prerequisites

Requirements

Cisco recommends that you have knowledge of these topics:

- Linux Interface

- Virtual Machine Environments

Components Used

The information in this document is based on these software versions:

- CloudCenter version 4.x

- CloudCenter Orchestrator (CCO)

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.

Background Information

If your enterprise requires proxy to access to the Internet, you must configure the docker container.

Problem

This is the procedure to reproduce the problem when the docker container is not able to reach the Internet.

When the root user tries to run the core_installer.bin on the CCO:

[root@localhost tmp]# ./core_installer.bin centos7 vmware cco

This error will show up:

Solution

Step 1. Run the core_installer.bin file with these arguments to create the core folder.

[root@localhost]# /core_installer.bin --noexec --keep

Step 2. Navigate to the core folder.

[root@localhost]# cd core

Step 3. From the core folder, run the setup.sh script to install docker.

[root@localhost core]# /setup.sh centos7 vmware docker

The script fails with this error "Failed in Docker".

Step 4. Modify the Dockerfile.

[root@localhost core]# vi docker/cliqr-container-worker/Dockerfile

Step 5. Add the proxy server info in the ENV section of the Dockerfile.

ENV JAVA_VERSION 1.7.0

ENV http_proxy http://proxy.company.com

ENV https_proxy https://proxy.company.com

Note: Replace proxy.company.com with the actual proxy server address.

Step 6. Create a systemd drop-in directory for the docker service.

[root@localhost core]#  mkdir /etc/systemd/system/docker.service.d

Step 7. Create the docker http-proxy.conf file.

[root@localhost core]# vi /etc/systemd/system/docker.service.d/http-proxy.conf

Step 8. Add the proxy server information.

[Service]

Environment="HTTP_PROXY=http://proxy.company.com"

Environment="HTTPS_PROXY=https://proxy.company.com"

Environment="NO_PROXY=localhost,127.0.0.1"

Step 9. If you have internal Docker registries that you need to contact without proxying, add them in the NO_PROXY environment variable:

Environment="HTTP_PROXY=http://proxy.company.com"

Environment="HTTPS_PROXY=https://proxy.company.com"

Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.company.com"

Note: Replace proxy.company.com with the actual proxy server address.

Step 10. Save the configuration file and reload the docker service.

[root@localhost]# systemctl daemon-reload

[root@localhost]# systemctl restart docker

Step 11. Build worker to the latest image with the help of these commands.

[root@localhost]# cd /tmp/core/docker/cliqr-container-worker

[root@localhost cliqr-container-worker]# docker build -t 'cliqr/worker:latest' .

Step 12. Restart the docker service.

[root@localhost]# systemctl restart docker

Step 13. Test if the docker container is configured.

[root@localhost]# docker search coreos

[root@localhost yum]# docker search coreos

NAME DESCRIPTION STARS OFFICIAL AUTOMATED

bhuisgen/docker-zabbix-coreos Zabbix agent for CoreOS server 11 [OK]

radial/coreos-pxe Spoke container for running dnsmasq as PXE... 7 [OK]

olalond3/coreos-bitcoind coreos bitcoind 4 [OK]

geowa4/coreos-toolbox Replace the default toolbox image on CoreO... 2 [OK]

million12/linode-coreos-api Deploy CoreOS on Linode. 2 [OK]

pablocouto/coreos-sshguard sshguard for CoreOS 1 [OK]

christianbladescb/newrelic-coreos Run newrelic's sysmond in a container on C... 1 [OK]

allen13/coreos-ansible-toolbox Control CoreOS boxes with ansible using a ... 1 [OK]

shift/coreos-ubuntu-etcd 1 [OK]

majidaldoiongithub/coreos-nvidia run privileged to install nvidia and cuda ... 0 [OK]

skopciewski/coreos-pypy Wrapper for installing pypy on coreos server 0 [OK]

yummly/consul-coreos Consul using etcd on CoreOS for bootstrap.... 0 [OK]

shift/coreos-ubuntu-confd 0 [OK]

jwaldrip/vault-coreos Vault for CoreOS 0 [OK]

zumbrunnen/coreos-gce Google Cloud SDK for CoreOS. Useful for dy... 0 [OK]

cheungpat/coreos-toolbox CoreOS toolbox based on alpine linux 0 [OK]

bretif/coreos-marathon Launch bootstrap script to create mesos/ma... 0 [OK]

openai/coreos-bootstrap Tools for bootstrapping a coreos node. 0 [OK]

docku/pxe-coreos 0 [OK]

kciepluc/coreos-ipxe container with dnsmasq / ipxe environment ... 0 [OK]

kciepluc/coreos-ipxeweb Webserver for bootstrapping CoreOS through... 0 [OK]

evergreenitco/fluentd-kubernetes-coreos-secure Fluentd capture logs containers on Kuberne... 0 [OK]

steigr/coreos CoreOS in Docker 0 [OK]

brandfolder/vault-coreos Vault for CoreOS with an etcd backend. 0 [OK]

kciepluc/coreos-toolbox custom toolbox container for CoreOS 0 [OK]

[root@localhost yum]#

Once the docker container is configured, you will need to continue the installation from core_installer.bin (if you are installing CCO).

Step 14. Modify the cliqr_modules.conf.

[root@localhost core]#  vi /etc/cliqr_modules.conf

Step 15. Add docker at the end of the file. This tells the core_installer.bin that docker is installed.

sysupdate

gateway

ntp

jdk8

tomcat8

gwtomcatapr

gwmongodb

docker

Step 16. Re-run the core_installer.bin to complete the installation.

[root@localhost tmp]# ./core_installer.bin centos7 vmware cco

Verifying archive integrity... All good.

Uncompressing Core Installer V 4.8.0.1.......................................................................................................................................................................................................................................................................................................................................................................................................................................

Installing Module: sysupdate

Module already installed: sysupdate

Installing Module: gateway

Module already installed: gateway

Installing Module: ntp

Module already installed: ntp

Installing Module: jdk8

Module already installed: jdk8

Installing Module: tomcat8

Module already installed: tomcat8

Installing Module: gwtomcatapr

Module already installed: gwtomcatapr

Installing Module: gwmongodb

Module already installed: gwmongodb

Installing Module: docker

Module already installed: docker

Installing Module: usermod

Installing Module: security

[root@localhost tmp]