Comments

Latest Posts

Run Free Arm-based Oracle Linux with 1 oCPU and 6G Ram (Install Docker/Docker Compose/Portainer/Ubuntu Virtual Desktop)

ARM is a RISC architecture. RISC stands for Reduced Instruction Set Computing. This means that the CPU has a limited number of instructions it can use. As a result, each instruction runs in a single cycle and the instructions are simpler. Meanwhile, x86 is a CISC architecture, which stands for Complex Instruction Set Computing.

ARM is designed to be smaller, more energy-efficient, and creates less heat.

One problem is that x86 programs can’t run on ARM. Most programming languages can target ARM just fine. Any currently-maintained programs should have few problems. Anything written in Assembly will need to be rewritten to work on ARM though.

There’s also an issue of speed. Since ARM has fewer instructions, developers need to use more instructions.


For x86_64 architecture 's CentOS 8 and Ubuntu 20.04 version, you can find this post about how to install Docker/Docker-Compose:




Choose Oracle Image. Default username is opc

You also can use Ubuntu 20.04 (not minimum) version to use Arm based shape. The installation for docker and docker compose will be a little different, which you can find out from this post (Install Docker, Docker-Compose, Portainer & Nginx on CentOS 8 & Ubuntu 20.04)

System Update

Check System Public IP:


[[email protected] ~]# curl https://ip.51sec.org/api
132.145.100.226
Update Oracle Linux 8 system to latest:

 [[email protected] ~]# yum upgrade -y && yum update -y
Update Ubuntu system to latest:

 [[email protected] ~]# apt update -y && apt upgrade -y



Install NodeQuery Monitor Sensor

Nodequery stopped the service since Sep 2021. Check other services in my post:

Free Cloud Server Monitoring Services: Netdata, New Relic, Datadog, Instrumental

You will get a one line sensor installation code from NodeQuery add a new server page. 

[email protected]:~# wget -N --no-check-certificate https://raw.github.com/nodequery/nq-agent/master/nq-install.sh && bash nq-install.sh gRa6yhaYPTkpogsqZRMFy0CMgfmj05
--2021-08-02 13:43:44--  https://raw.github.com/nodequery/nq-agent/master/nq-install.sh
Resolving raw.github.com (raw.github.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to raw.github.com (raw.github.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://raw.githubusercontent.com/nodequery/nq-agent/master/nq-install.sh [following]
--2021-08-02 13:43:44--  https://raw.githubusercontent.com/nodequery/nq-agent/master/nq-install.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4781 (4.7K) [text/plain]
Saving to: ‘nq-install.sh’

nq-install.sh                                            100%[===============================================================================================================================>]   4.67K  --.-KB/s    in 0s

Last-modified header missing -- time-stamps turned off.
2021-08-02 13:43:44 (71.0 MB/s) - ‘nq-install.sh’ saved [4781/4781]

|
|   NodeQuery Installer
|   ===================
|
|   Downloading nq-agent.sh to /etc/nodequery
|
|   + 2021-08-02 13:43:45 URL:https://raw.githubusercontent.com/nodequery/nq-agent/master/nq-agent.sh [8537/8537] -> "/etc/nodequery/nq-agent.sh" [1]
|
|   Success: The NodeQuery agent has been installed







Install Docker


dnf install -y dnf-utils zip unzip
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

dnf remove -y runc
dnf install -y docker-ce --nobest

systemctl enable docker.service
systemctl start docker.service

systemctl status docker.service
docker info
docker version
Ubuntu System:

apt install docker.io -y && apt install docker-compose


Install Docker-Compose


yum install -y libffi libffi-devel openssl-devel python3 python3-pip python3-devel
pip3 install docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Install Portainer

Commands to install Portainer:

[[email protected] ~]# docker volume create portainer_data
portainer_data
[[email protected] ~]# docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Nginx configuration:

[email protected]:/etc/nginx/conf.d# cat portainer.conf 
server {
    listen       80;
    server_name  opc2armportainer2.51sec.eu.org;

location / {
    proxy_pass       http://portainer:9000;
    proxy_http_version         1.1;
    proxy_read_timeout 300;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-PORT $remote_port;
           }
}
[email protected]:/etc/nginx/conf.d# 



Run a Ubuntu 20.04 Desktop

Docer hub image repository: https://hub.docker.com/r/fredblgr/ubuntu-novnc
docker run -p 6080:80 fredblgr/ubuntu-novnc:20.04

Note: This version Novnc docker is good for Arm64 architecture. For other 32b or 64b i386 version's docker, check post: https://blog.51sec.org/2021/01/install-ubuntu-1804-xfce4-desktop-in.html


http://<Public IP>:6080


The docker support basic http password authentication:

docker run -d -p 6080:80 -v $PWD:/workspace:rw -e [email protected] -e RESOLUTION=1680x1050 --name ubuntu-novnc fredblgr/ubuntu-novnc:20.04
Authenticate username is default one: root
Password is the one you set using environment variable, HTTP_PASSWORD.

Default log in user is root. But you can user variables, user and password to change it. 
-e USER=netsec -e PASSWORD=password1234

--rm parameter will remove docker after it stopped.

From Ubuntu terminal, you can install firefox to have a browser for your internet. 


apt update -y && apt install firefox -y
For Nginx reverse proxy configuration:


[email protected]:/# cd /etc/nginx/          
[email protected]:/etc/nginx# cd conf.d/
[email protected]:/etc/nginx/conf.d# cat novnc.conf 
server {
    listen       80;
    server_name  novnc.51sec.eu.org;

location / {
    proxy_pass       http://14.23.12.11:6080;
    proxy_http_version         1.1;
    proxy_read_timeout 300;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-PORT $remote_port;
           }
}
[email protected]:/etc/nginx/conf.d# 


References













No comments