Categories
iPhone app Software development Technology

Docker – second take

Reading Time: 3 minutes

(Update 08-26-2020) Technically 3rd take. I was following along with the Google Cloud Storage ClamAV tutorial, and had an issue of not being able to connect to port 3310 on GCP. (Update 08-29-2020) It was solved. Some tips:

====

1) There were some typos: such as the directory related to the git project, as well as environment variable for the bucket (in couple places);

2) Need to run the below command before deploy: Assign bucket permissions before “gcloud app deploy” (as in section Create the malware-scanner service: step 5)

3) https://github.com/GoogleCloudPlatform/docker-clamav-malware-scanner/issues/1 (move the local variable out of the large bracket {})

4) https://github.com/GoogleCloudPlatform/docker-clamav-malware-scanner/pull/4 (the solution is to increase the memory footprint in the app.yaml file)

====

Last but not least, one does not have to delete the project, the quick way to save the money is just to turn off the app via app engine => settings => disable application.

I also looked around and found another ClamAV tutorial using Java. The second one worked for me locally. I was also able to put an image to the docker hub (using the code from the spring boot docker tutorial). I was able to push the docker image to pcf too. The one thing remaining is I had a 502 gateway issue when I test the end point (local was working fine; postman tip here). Actually later I was be able to make the GCP example (the node js example) work locally too. Now the next step is to make them work in a PCF or a GCP cloud environment (not just local).

(Update 02-04-2019) What Is Container Orchestration? (by Isaac Eldridge at New Relic).

I also followed along the Exploring Docker [1] – Getting Started by Traversy Media. I did make the node.js and MongoDB work on my local MacBook, but I could not make them working on my DigitalOcean droplet due to mismatch of Docker versions of “Docker Compose”, the root cause was the Ubuntu on my Droplet was a a bit old (14.0.4). I need to upgrade it to make the versions compatible.

Some more links for the Traversy Media docker-node-mongo example. Youtube video here. Github repo here.

Two more (TBD, or for references): Dockerize a Node.js app connected to MongoDb

Containerizing a Node.js Application for Development With Docker Compose

(Update 02-13-2018) So I found out today I have AWS bill of

$2.62 (mostly due to EC2 instances) today. This is due to the fact that I did fire up the VM as well as the docker swarm instances (total 9? maybe due to I ran the deploy script multiple times?) Anyway I fired up the instance last night, this evening I looked at the “instances” and looked at the bill, I know what happened. I still did not make the connection from outside to ec2 working though. For the time being, I “terminated” the docker swarm, and stopped AWS VM.

(Update 02-12-2018) I am also following the tutorial at Docker’s official website. I am at step 6 here. And right now, I am stuck in connecting to the AWS vm (was following this Docker guide): step 6 “docker node ls”. I did follow the steps to create docker credentials for AWS.

error during connect: Get https://192.168.99.102:32768/v1.35/nodes: http: server gave HTTP response to HTTPS client

Note this IP address looks like the local default machine: one thing I am not quite sure is how the local connects AWS

(Original 01-31-2018) I installed docker on my mac a while ago and did a simple tutorial. But I never had much chance to play with it until recently. After the training, esp. after I saw use docker container to host Tomcat, and then use Jenkins to startup Tomcat (build and deployment), this whole thing got me interested in docker again. Note I have been learning about docker contain and they seem to be the future deployment model for scalable mobile apps backend: e.g., I know the Robinhood app (the free stock trading app) is container based in the back.

Some resources I used to get started:
1) Youtube docker tutorials (11-18-2018: such as this one Demystify Docker; also noticed this one Docker for GCP. I will see if I can do the training exercise again I mentioned above).
2) Install docker or docker.io on Ubuntu (I have a digitalocean droplet / VM, and its OS is Utuntu);
3) Overcome the error message:
FATA[0000] Get http:///var/run/docker.sock/v1.17/version: dial unix /var/run/docker.sock

The answer is this:

The problem is that your user has not been added to the docker group.

Try:

sudo usermod -a -G docker
If you don’t want to log in/out from your current shell, run:

newgrp docker

Last but not least, install Jenkins on Ubuntu 14.04.

Other error messages (note I am on a Mac)
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? (when I tried to run some docker command)

It seems the solution is
eval “$(docker-machine env default)”

References:

How To Remove Docker Images, Containers, and Volumes

Docker Usage

Part 1 — Virus Detection Service using ClamAV and Java

Part2 — Dockerized File Virus Detection Service using ClamAV and Spring Boot