Saturday, April 13, 2019

Ubuntu 18.04 + Docker Setup

I am setting up a new Docker Engine running on Ubuntu 18.04
During the Ubuntu installation, I selected Docker Engine as part of the deployment setup. By default the Docker Engine Service is run by Snap.

My environment uses web proxy to hit the Internet and internal DNS servers only are allowed. Docker Daemon or Docker Containers must use web proxy and internal DNS to hit the Internet.

To setup Ubuntu with static IP, pointing to the right DNS, netplan must be created
create a YAML file in the /etc/netplan/

> sudo vi /etc/netplan/99-local-init.yaml

network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 10.0.0.1/24
gateway4: 10.0.0.254
nameservers:
search: [domainlocal.tld]
addresses: [10.0.0.2, 10.0.03]

ps: addresses: [10.0.0.2, 10.0.0.3] are the local DNS servers

To get Docker Engine to use web proxy and local DNS servers, Drop-In configuration files must be created. Check the Docker Engine service name under /etc/systemd/system/ folder. My Ubuntu 18.04 installation has got snap.docker.dockerd.service name

Create a folder with the same name of the service name and add ".d" at the end of the folder name

> sudo mkdir -p /etc/systemd/system/snap.docker.dockerd.service.d 

Then you can create as many as .conf files in that folder

To create web proxy configuration

> sudo vi /etc/systemd/system/snap.docker.dockerd.service.d/proxy.conf

[Service]
Environment="HTTP_PROXY=http://myproxy.domainlocal.tld:8080/" "HTTPS_PROXY=http://myproxy.domainlocal.tld:8080/" "NO_PROXY=localhost,*.domainlocal.tld"

To create DNS setting

> sudo vi /etc/systemd/system/snap.docker.dockerd.service.d/dns.conf

[Service]
ExecStart=
ExecStart=/usr/bin/snap run docker.dockerd --dns 10.0.0.2 --dns 10.0.0.3 --dns-search domainlocal.tld

ps: ExecStart= must be defined in the first line to reset that flag

The daemon must be restarted

> sudo systemtcl daemon-reload
> sudo systemctl restart snap.docker.dockerd

To build / run process within the Docker Container, pass the flags:

> sudo docker build --build-arg http_proxy=http://myproxy.domainlocal.tld:8080 --build-arg https_proxy=http://myproxy.domainlocal.tld:8080 -t dockerhubname/imangename .

Have fun!


Wednesday, February 13, 2019

Microsoft Ignite Sydney 2019








Friday, December 07, 2018

Westpac Super.Tech Q4 Individual Award Winner

And to close the year 2018, I have been nominated and won the Q4 Individual Award! 

It has been a long and challenging year for me :)

Saturday, November 03, 2018

Friday, September 21, 2018

Cleaning Up CSC Folders

C:\Windows\CSC folder is the offline files folder. It has special permissions. Without the correct permission, you won't be able to delete anything in it

To delete the content of C:\Windows\CSC, you need to modify its permissions

> cd c:\Windows
> takeown /f CSC /r /a /d y
> icacls CSC /grant Administrators:F

Then you can navigate to the folder and start deleting files

Wednesday, August 01, 2018

Publish TeamCity via Sophos XG Firewall

I am running TeamCity product at home for my development work and would like to publish the site via my Sophos XG Firewall. TeamCity runs on the internal domain namespace and to publish it to the Internet, you need to configure it so that it recognises the external domain namespace.

I don't want to make any change on the TeamCity, and luckily Sophos can do it !

Create Business Application Rule on your Sophos Firewall make sure the "Rewrite HTML" is selected as shown below. That's it!