Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

Dockerfile with 2 x FROM sources

Scheduled Pinned Locked Moved App Packaging & Development
7 Posts 4 Posters 271 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • timconsidineT Online
    timconsidineT Online
    timconsidine App Dev
    wrote on last edited by
    #1

    I've seen a few interesting FOSS apps which in their Dockerfiles have 2 FROM ... statements.
    e.g.

    FROM elixir:1.12-alpine as build
    ...
    ...
    FROM elixir:1.12-alpine
    ...
    ...
    

    Ignoring that these examples are not the Cloudron base images, just wondering how this might be handled in building a Cloudron package. Is it possible ?
    Probably going will turn out to be a dumb question : humour the newbie

    mehdiM 1 Reply Last reply
    0
  • mehdiM Offline
    mehdiM Offline
    mehdi App Dev
    replied to timconsidine on last edited by
    #2

    @timconsidine This is just a Docker syntax that allow you to have a temporary container that does some stuff (usually building things), then you can access files built during previous steps in subsequent ones and add them to your image.

    Basically, it's just a way to simplify cleanup : instead of installing a bunch of tools that you only need during build time, then having to remove them (or worse, leave them in the final image), you can do the build in the temporary container, then import the build results in the final container.

    timconsidineT 1 Reply Last reply
    3
  • timconsidineT Online
    timconsidineT Online
    timconsidine App Dev
    replied to mehdi on last edited by timconsidine
    #3

    @mehdi thanks for the explanation šŸ‘
    Maybe I will get brave and try it out on a project

    1 Reply Last reply
    0
  • girishG Offline
    girishG Offline
    girish Staff
    wrote on last edited by girish
    #4

    This style is called multistage builds, if you want to search/read more. FWIW, they will work fine on Cloudron, we use standard docker images. That all our apps use cloudron/base:3.2.0 as the base image is only a convention that helps us maintain things more easily. (as in, if each each app package had it's own coding style and convention, it becomes hard for us to navigate the code and update them).

    timconsidineT 1 Reply Last reply
    1
  • timconsidineT Online
    timconsidineT Online
    timconsidine App Dev
    replied to girish on last edited by
    #5

    @girish thanks, will research and play around a bit

    fbartelsF 1 Reply Last reply
    0
  • fbartelsF Offline
    fbartelsF Offline
    fbartels App Dev
    replied to timconsidine on last edited by
    #6

    @timconsidine Multi stage builds are super easy to use. As long as binaries are compatible, you could even pull binaries from pre existing containers.

    I’m doing the same in https://github.com/fbartels/cloudron-drone-app/blob/master/Dockerfile

    timconsidineT 1 Reply Last reply
    2
  • timconsidineT Online
    timconsidineT Online
    timconsidine App Dev
    replied to fbartels on last edited by
    #7

    @fbartels thanks, nice example šŸ‘

    1 Reply Last reply
    0

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Login

  • Don't have an account? Register

  • Login or register to search.