uboslinux / ubos-tools

UBOS development/deployment tools
7 stars 0 forks source link

Docker-based development setup for the Mac #35

Closed jernst closed 3 years ago

jernst commented 3 years ago

Something like:

For a first-time, greenfield developer interested in a demo app, like the guestbook app:

  1. Install Docker for Mac if needed

  2. on the Mac, “git clone” an example app

  3. on the Mac, “git submodule update” to pull in Mac-platform tools to make things easier

  4. "docker-compose up” a two-container app. The containers will be:

    1. UBOS with common developer tools installed (“ubos-build”)
    2. UBOS production runtime (“ubos-test”)
  5. To build and deploy, on the Mac, something like “bin/ubos-build-deploy”

  6. Access web app at http://localhost:8080/

For real-world development:

ethn commented 3 years ago

I really like the two-container idea for development.

I would be tempted to make a single training/sandbox image with the guestbook in it.  Skip the cloning and the potential to miss the submodule step and jump right into the meat of it. 

  1. To build and deploy, on the Mac, something like “bin/ubos-build-deploy”

I'm finding that I need to spend a bunch of time inside the container(s) to understand things. Maybe this isn't what you were implying by "on the Mac," but I wouldn't think it's worth it to build a lot of tools that help people avoid getting inside the container and messing around.

jernst commented 3 years ago

Turns out that Docker apparently has no good way of sharing a directory for read/write by a non-root user between the host and the container. Which practically means we cannot run makepkg inside the container on code that is editable on the host where the developer's editor runs.

Apparently Microsoft, for that reason, implemented an entire NFS-like filesystem in Visual Studio that they then mount into the container. And also apparently, Docker Inc has recognized the problem and promises "Dev Environment" as part of Docker Desktop, but so far that has not been released.

ethn commented 3 years ago

I probably don't understand exactly what you're wanting, but I haven't had any trouble running makepkg within a subdirectory on my mounted volume:

https://github.com/decko-commons/decko-ubos/blob/master/Rakefile

On Thu, May 27, 2021 at 4:41 PM Johannes Ernst @.***> wrote:

Turns out that Docker apparently has no good way of sharing a directory for read/write by a non-root user between the host and the container. Which practically means we cannot run makepkg inside the container on code that is editable on the host where the developer's editor runs.

Apparently Microsoft, for that reason, implemented an entire NFS-like filesystem in Visual Studio that they then mount into the container. And also apparently, Docker Inc has recognized the problem and promises "Dev Environment" as part of Docker Desktop, but so far that has not been released.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/uboslinux/ubos-tools/issues/35#issuecomment-849927462, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAFLEHVTJEFMPKUKWTE2LDTP2VBBANCNFSM445JE5UA .

-- Ethan McCutchen Executive Director, Decko Commons Decko. You hold the cards.

jernst commented 3 years ago

Don't you get all the files owned by root? So you can't actually change them if you run makepkg as shepherd? But then I think makepkg doesn't like to run as root?

ethn commented 3 years ago

I'll pay more attention next time (should have a new decko release soon). But I definitely run makepkg as shepherd.

On Thu, May 27, 2021 at 11:38 PM Johannes Ernst @.***> wrote:

Don't you get all the files owned by root? So you can't actually change them if you run makepkg as shepherd? But then I think makepkg doesn't like to run as root?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/uboslinux/ubos-tools/issues/35#issuecomment-850087556, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAFLEGPM36AV5ZGLYYT3O3TP4F3PANCNFSM445JE5UA .

-- Ethan McCutchen Executive Director, Decko Commons Decko. You hold the cards.