DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: xiao2024
今日帖子: 16
在线用户: 13
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/2 10:56:19
标题:
How to run app FMX (GUI) in a Ubuntu on Docker environment? by Emailx45 浏览:1801
加入我的收藏
楼主: How to run app FMX (GUI) in a Ubuntu on Docker environment? by Emailx45

hello boys and girls,

here my tutorial to use Docker and RAD Studio to deploy your (GUI or not) apps in Ubuntu Linux!

Now you can deploy your apps with all infra-structure to local or remote server!

the article is a little big, then, I can not reproduce here because the forum "deny" many text in my post!

to go WeDelhi forum and see if you want, ok?

if your not registered, just do it -- it's free for all!

How to run app FMX (GUI) in a Ubuntu on Docker environment? by Emailx45

with screenshots for show how?

How to run app FMX (GUI) in a Ubuntu on Docker environment? by Emailx45
RAD Studio + Docker + Ubuntu + XvcSrv togheter + WSL

https://wedelphi.com/t/422402/#post-3471139


NOTE: Docker share images files with WSL if it is installed in your computer
此帖子包含附件:
PNG 图像
大小:46.4K
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 yxsoft (yxsoft) ★☆☆☆☆ -
盒子活跃会员
2022/7/2 17:40:36
1楼: Very useful scenario, good work!
----------------------------------------------
Great!
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2022/7/2 18:12:31
2楼: 我现在用虚拟机装 Linux;

如何使用 Docker 还没玩过,不会用。
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/2 23:08:10
3楼: How all works:

1) scenary 1 --> no WSL installed in MSWindows!
a) Docker will be installed and needs Hyper-V activated on BIOS
b) Docker use "sharing file" to share one image with all containers, for that needs Hyper-V

2) scenary 2 --> with WSL installed in MSWindows!
a) Docker will be installed and "DONT" needs Hiper-V because it can use WSL system
b) Docker use "sharing file" to share one image with all containers, for that needs WSL
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/2 23:09:23
4楼: remember: DOCKER is created based on Linux subsystems of virtualization (basically using KVM and others) for that it was create (initially) by Linux systems... like Ubuntu, macOSes etc... later, to MSWindows!

Said this, if you have a macOS or Linux hosts, you have more compatibilities between "hosts" and "clients" (+/-  you understood?)

then, why to use Docker ?

as I said in my post in WeDelphi, it's simple!
-- you can create a "image customized of your O.S. (Windows, Linux, macOS if Apple let) and "upload" to a hub (like Docker-Hub) public or privated!

after this, your "image" can be download for any one to use it!
at end, you'll have your infra-structure and libs (softwares etc...) all ready for use at any time!

No more format C: ... install or setting devices and install O.S. and install applications... NO! NO! NO!

you can upload your infra-structure (image custom) for a "Local computer" or "Remote computer (clouds)"... easy easy... just do the reference in your "Dockerfile" ... FROM ....(your image custom) ... the rest is with Docker!

NOTE: Docker dont re-download files already downloaded before, just new files redefined on "Dockerfile" on re-build image!

if your needs changes your image or container, dont worry. just rebuild it your image re-defining your "Dockerfile"...

each day, a new computer ready for use!

now if you have many distincts scenary with same base O.S, for example:

1 image=O.S. and infinite containers can be created!

the Docker just share and use the resources indicated in your "Docker file" for each container... then, you dont need a "big hardware" for "little tasks".

so... it's really good for all developers currently!

regular VMs it's good, but softwares like "DO"cker it's better! no doubt!

take a have fun boys and girls!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/2 23:18:24
5楼: more: the Linux have a distribution named "Alpine" that needs < 35MBytes"!

https://hub.docker.com/_/alpine

WOW! just add your libs and "Voilà"!

NOTE: 
-- Alpine DONT have libs necessary to RAD Studio apps! >:)) HA HA HA
-- good for RaspBerry PI devices!

normally Ubuntu to RAD Studio needs just < 900MBytes in disk! 
a NEW COMPUTER in < 900MBytes!

OBS: 
my Ubuntu in WSL have > 6GBytes!  WOW! same libs than Docker image!
my Ubuntu in VirtualBox > 22GBytes! WOW!!!



Github with all supported platforms and O.S.
https://github.com/docker-library/official-images/tree/master/library
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/2 23:28:55
6楼: to RAD Studio by Embarcadero ready for use!
--- no needs any configuration by developer

https://hub.docker.com/u/radstudio
https://hub.docker.com/r/radstudio/pa-radserver-ib
https://hub.docker.com/r/radstudio/pa-radserver
https://hub.docker.com/r/radstudio/paserver
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2022/7/3 0:12:52
7楼: emailx45, thank you.
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/3 0:19:34
7楼: currently...
此帖子包含附件:
PNG 图像
大小:109.9K
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/3 0:44:31
8楼: basically you do this in MSWindows:
----------
#download the imge ubuntu from Docker-hub  -- if you want download any image on Docker hub...
docker pull ubuntu
----------

#create a local-image based on ubuntu-from-Docker-hub
#here "Dockerfile" will be used...
docker build -t meuubuntu-paserver  .     # you can add others params necessary for you

#create a container based in my local-image
#example in macOS computer/Linux: --platform linux/amd64  to avoid download to another architecture...
# -v = volume = mapping a folder-host to folder-Docker-image-Linux (in the container)
# $(pwd) in Linux = where am I? What folder? in host-PC
echo "PAServer Password: securepass"
docker create -it --name DatasnapTest --platform linux/amd64 \
-v "/$(pwd)/scratch-dir:/root/PAServer/scratch-dir" \   # mapping a drive/folder for easy use in deployment...
-e PA_SERVER_PASSWORD=securepass \
-p 64211:64211 -p 8082:8082 meuubuntu-paserver

# here my OK for test!
docker create -it --name meu-paserver-container --platform linux/amd64 -p 64211:64211 -p 8082:8082 -e PA_SERVER_PASSWORD=embtdocker meuubuntu-paserver

#start my container
docker start meu-paserver-container

#stop my container
docker kill meu-paserver-container

#deleting my container
docker rm meu-paserver-container

#deleting my image
docker rmi meuubuntu-paserver

#how to know info about Docker session or containers running
docker ps   #  containers / images in use
docker info # docker informations


#sample by Marcus Geuze
docker run -d --restart unless-stopped -p 64211:64211 -p 8082:8082 -p 80:80 meuubuntu-paserver:latest


NOTE IMPORTANT:
-- to GUI apps, you needs use a XServer running MSWindows to run it in Linux!!!
-- same than "WSL - Windows Sub-System Linux" example!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 sxqwhxq (步惊云) ★☆☆☆☆ -
普通会员
2022/7/5 20:25:18
9楼: 大师,docker里可以装linux arm吗,然后可以使用fmxlinux编译linux arm app吗?
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/5 22:29:40
10楼: First, a Docker is a "virtualizer" based on Linux virtualizers, like KVM!

NOTE:
--- Hardware: any "phisical" element in the process
--- Virtual Machine/Virtualizer: any software to "simulate a hardware environment"
--- User: anyone, like: John, the developer, the tester, etc...
--- Client: any application client, ex.: VirtualBox is a client in relationship to the Operating System.
--- Operating System: any software to "give life" for your hardware
--- Application: any software, understanding, to end-user

In virtualizer likes VirtualBox and similars, we have basically the follow layers:
1) Hardware
---- phisical components (like: Servers, DataCentes, PCs, mobiles, etc...);
2) Hipervisor
---- (virtualizer like: VirtualBox, VMWare, ProxyMox, KVM, Hyper-V, etc..), works like a "Operating System for your hardware";
---- your "mission" it's create another "Operating System" (installed directly on Hardware), allowing create another "Operating System" layer... ex. VirtualBox VMs.
3) Virtual Machine
---- create a "new" hardware (virtually) to receive an "Operating System" to run some "Application" to end-user
---- Ex.: VirtualBox, VMWare, etc...
4) Operating System
---- the final "Operating System" to run the "Application" of user.
---- Ex. MS Windows 10, Ubuntu, Big Sur, etc...
5) Application
---- any "Application" of the user
---- Ex.: DataSnap Server, My Account System, etc...

NOTE:
-- in these concept, we allocating the "hardware whole" just to run an "Application"!
---- Ex.: create a "VM" with MSwindows 10 to run my DataSnap Server in a PC i9 with 512GB RAM, GPU nVidia 12GB, 16TB disks, 100 Ethernet interfaces, 16 Mouses, 14 keyboards, etc... (ha ha ha...) :love:
---- Is it really necessary?

What we can note here?
there are much hardware resources to a specific task from the final-software!
if the final-software needs any changes on infra-structure is necessary another hardware and setting!
this "changes" can "break" anothers final-software installed
static environment, like a "read-only environment"!


With "Docker" (or similars in each platform), we have this layers:
1) Hardware
---- phisical components
2) Operating System
---- any O.S. supported!
3) Container Engine (==> Docker, or any other similar!)
---- each "container", in fact, just share the same Kernel for O.S. host ("from platform-image of platform") and isolate the specific characteristics for your use!, in a "name-spaces" concept!

NOTE:
-- in these concept, we allocating just hardware-resources minimum and necessary to run the final-applications!
---- Ex.: my application needs just 400MB RAM and 20MB disk, then, why a VM with 2GB RAM, 30GB disk?
-- the "containers" is a "packages isolatating", then, we can have many "containers" of a same "platform-image"! each one is distinct each other and independent!
---- all libs/files necessary to run your application will be packed in a "container"
---- easy to install and run in any environment local or remote! take and run!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/5 22:36:28
11楼: then, if you "HOST" is ARM, and your "Operating System" that you go to use accept "ARM" archtectur, then, Docker just use it!

Docker dont create a new "virtual PC", it just use the phisical-resources to create a "specific container where the resource is used"... you understood?

like VirtualBox create a VM with all resources non-mutable (all phisical components are simulated by software and dont changes like a real-pc), and DONT create new phisical-components-virtualized.

then, Docker is just a optimizer when using resources in your host-pc. or be, it dont use nothing that you dont need! But the resources should exists in your host, else, how to use some that not exists?

you understood?
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/5 22:39:44
12楼: Multi-arch support on Docker Desktop
Docker Desktop provides binfmt_misc multi-architecture support, which means you can run containers for different Linux architectures such as arm, mips, ppc64le, and even s390x.

This does not require any special configuration in the container itself as it uses qemu-static from the Docker for Mac VM. 

Because of this, you can run an ARM container, like the arm32v7 or ppc64le variants of the busybox image.

https://docs.docker.com/desktop/multi-arch/
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 sxqwhxq (步惊云) ★☆☆☆☆ -
普通会员
2022/7/5 22:45:33
13楼: 大师,目前arm开发是一个热点,您能否简易地说一下怎样在docker里安装linux arm,从而构建可能的linux arm的fmxlinux开发环境?
如果我能让fmxlinux连接到一个linux arm,我怀疑fmxlinux能够编译arm、我目前做不到的原因,可能是paserver 在工作在vwware里,而vmware只能安装x86的linux。
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/5 23:00:32
14楼: First, DOCKER DONT INSTALL ANY O.S.!!!

It just "is a method of you choice any resource from your host-pc/Operating System you need in your final-"container"...

let's try understood this:

1) I need a MSWindows 64bit just for run my app-server with some resources basic... 

Ok, then you needs a O.S MSWin 64bits, but you host-Pc dont run MSwin64bits... ops!!! how to do then?  it's not possible... and Docker dont help here!

VirtualBox help me then?  maybe.... if it can "emulate a MSWin64bits"!

But, your CPU it's 64bits?  IF (yes) THEN continue  ELSE  exit!

now, let's go to Docker!

1) I have a phisical pc with 64bits CPU, ARM!

Oh! then I can run any O.S. 64bits to ARM here in my pc! Oh!

in this scenary, you can first:
1) install a O.S. to ARM archtecture 64bits
2) emulate anothers scenary ARM arch 64bits
3) install any others O.S. ARM arch 64bits

now, if need emulate many scenarys with distincts distribution... then you can use Docker for this!

At end, Docker is just a "package manager" for your "file layers", or be, if a "container" needs just lib XORG, and other need just lib X11, then, you can create two "containers" (one for each other)

the image-base (shared) will contain 2 libs, but when run, just 1 for each container.... this is done by Docker....

you understood now?

---1 image-base-O.S.  with 2 libs
---2 container (1 with XORG, 1 X11) = Docker

at end, your apps dont need all resources in your host-PC for run. then, you can many others scenary in your same pc! optmized!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/5 23:04:40
15楼: PAServer run in MSWindows and Linux / macOS!

look this:

(x86 = ???) what is it?

C:\Program Files (x86)\Embarcadero\Studio\21.0\PAServer\setup_paserver.exe.
C:\Program Files (x86)\Embarcadero\Studio\21.0\PAServer\PAServer21.0.pkg.

NOTE in Embarcadero HELP SYSTEM:
On Windows, you only need to install the Platform Assistant if you are using a 32-bit Windows development system connected to a 64-bit Windows target system. If you are using a 64-bit Windows development system, you do not need to install the Platform Assistant. However, installing the Platform Assistant on your development system enables you to use the Deployment Manager.

https://docwiki.embarcadero.com/RADStudio/Sydney/en/PAServer,_the_Platform_Assistant_Server_Application


PAServer is a 32bits software with parts to 64bits communication (to Debugger tasks)
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2022/7/6 11:13:03
16楼: Can install Delphi IDE in Docker? then I can install several version of Delphi IDE in my computer without VirtualBox.
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/6 23:15:26
17楼: first, if your PC is ok for receive many O.S. (consuming resources in same time), I think that "YES".

You can found in Docker-hub or Microsoft "Windows-images" (many) starting with "Windows core"... until others more specific customizations! Official or not!

then, if your PC it's ok to run it, you can install your RAD Studio IDE in it.

in Docker-Hub you can found Microsoft Official distribution:
https://hub.docker.com/_/microsoft-windows

windows/nanoserver: Nano Server base OS container image
windows/servercore: Windows Server Core base OS container image
windows/server: Server base OS container image
windows/insider: Insider version of this base OS image.

NOTE: Read the "TAG" description for know more about each image that will be downloaded 
ex.: docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022

This is a base image for Windows Server containers. This image carries the Nano Server base OS image.

For more information about servicing lifecycles, visit Base Image Servicing Lifecycles.
https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/base-image-lifecycle
----------

of course, you needs to know if this "images" it's ok for install RAD Studio or needs add new libs ( like .NET Frameworks, DirectX (for FMX), etc...)

at end, you can try install your RAD. 

you understood?

NOTE: 
--- in my opinion, this only necessary if you needs run 2 or more instance of "same RAD", because the RAD can co-exists with others editions, like, RAD 10.1 and 10.2 for example in the same pc!

--- RAD Studio allow you run another instance just indicating another "profile / user" in your command-line! then you can use distincts components / pallete for example!

BDS.EXE -R <<your-registry-key>>
Alternate registry key. Allows you to specify an alternate base registry key so you can run two copies of the IDE using different configurations. This allows component developers to debug a component at design time by using the IDE as the hosting application, without the debugging IDE interfering by trying to load the component package being developed.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/6 23:18:21
18楼: @pcplayer

REMEMBER:
DOCKER DONT INSTALL ANY SOFTWARE FOR USE -- it's not a O.S.
it's only "control the use of "system files layer", some like: for this scenary use this files!  --- you understood?

who install the softwares is the Operating System!!! in this case, MS Windows!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/6 23:21:50
19楼: DONT FORGET
same using a "image" of your choice, you need have "COMMERCIAL LICENSE" for use in fact!
be Operating System, be RAD Studio, or any other software not FREE for use!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2022/7/6 23:51:38
20楼: NOTE:
always review my posts, because I always re-edit with new informations or delete wrong informations!


sorry, sometimes I do it!
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行109.375毫秒 RSS