Recent

Author Topic: minimal docker to run fpc program  (Read 5642 times)

Blestan

  • Sr. Member
  • ****
  • Posts: 461
minimal docker to run fpc program
« on: July 25, 2017, 01:04:09 pm »
hi guys! does anyone have some experience and/or code to build minimal docker images to run fpc compiled program like go containers?
Speak postscript or die!
Translate to pdf and live!

Thaddy

  • Hero Member
  • *****
  • Posts: 14197
  • Probably until I exterminate Putin.
Re: minimal docker to run fpc program
« Reply #1 on: July 25, 2017, 03:13:31 pm »
I thoroughly do not understand what you mean... almost reported it as SPAM.
Specialize a type, not a var.

tr_escape

  • Sr. Member
  • ****
  • Posts: 432
  • sector name toys | respect to spectre
    • Github:
Re: minimal docker to run fpc program
« Reply #2 on: July 25, 2017, 03:16:07 pm »
Hello Blestan do you mean linux container? Like as:

https://distrowatch.com/table.php?distribution=container


Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: minimal docker to run fpc program
« Reply #3 on: July 25, 2017, 03:42:52 pm »
@thaddy: ooh please thaddy you know me i will never post a spam in the forum.. O:-) i need something like this https://blog.codeship.com/building-minimal-docker-containers-for-go-applications/
Speak postscript or die!
Translate to pdf and live!

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: minimal docker to run fpc program
« Reply #4 on: July 25, 2017, 03:49:34 pm »
I thoroughly do not understand what you mean... almost reported it as SPAM.
He probably means this:
https://www.docker.com/what-docker
https://hub.docker.com/_/golang/
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: minimal docker to run fpc program
« Reply #5 on: July 25, 2017, 03:55:21 pm »
@avra : i know what docker is i want minimal container like shown in the link to deploy fpc micro services in the cloud
Speak postscript or die!
Translate to pdf and live!

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1313
Re: minimal docker to run fpc program
« Reply #6 on: July 25, 2017, 03:56:03 pm »
It's like a Linux mini-VM that can run an FPC program. Which would be most of them, probably. Libc would have to be available.

Or a mini-VM with FPC pre-installed.

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: minimal docker to run fpc program
« Reply #7 on: July 25, 2017, 04:00:26 pm »
yes is exacly that... minimal depeddencies ... not the fp compiler installed may be libc .... and the program it self "injected" in the image of the container... need some ideas/help on the toolchain to be used to buid the image
Speak postscript or die!
Translate to pdf and live!

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: minimal docker to run fpc program
« Reply #8 on: July 25, 2017, 08:49:11 pm »
The same scratch container can be used, so the steps are the same too, even easier since fpc compiles statically already.
Code: [Select]
FROM scratch
ADD yourcompiledprog /
CMD ["/yourcompiledprog"]
should be sufficient. Indeed it is:
Code: [Select]
$ sudo docker build -t hello -f hello.scratch .
[sudo] password for leledumbo:
Sending build context to Docker daemon  40.73MB
Step 1/3 : FROM scratch
 --->
Step 2/3 : ADD hello /
 ---> 5479290cd757
Removing intermediate container e8000e26f899
Step 3/3 : CMD /hello
 ---> Running in d862efdcf885
 ---> e8004dc298a6
Removing intermediate container d862efdcf885
Successfully built e8004dc298a6
Successfully tagged hello:latest
$ sudo docker run -it hello
Hello, World

Blestan

  • Sr. Member
  • ****
  • Posts: 461
Re: minimal docker to run fpc program
« Reply #9 on: July 25, 2017, 09:49:34 pm »
thank you very much ... after reading alot of doker and go code i came to the same conclusion and will try it asap
Speak postscript or die!
Translate to pdf and live!

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: minimal docker to run fpc program
« Reply #10 on: July 27, 2017, 08:25:35 am »
The same scratch container can be used, so the steps are the same too, even easier since fpc compiles statically already.
Thank you for your effort  :D 8) :D
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

 

TinyPortal © 2005-2018