carbon-lang icon indicating copy to clipboard operation
carbon-lang copied to clipboard

Add ubuntu:20.04 docker images

Open NicoZweifel opened this issue 2 years ago • 7 comments

Ubuntu 20.04 base image and examples using github, a copy instruction and volumes.

I was using this to run examples on a windows machine since it is more comfortable than switching OS or using the WSL subsystem directly. If this is something that other people would like to have I can add other versions of ubuntu and other linux distributions.

NicoZweifel avatar Jul 23 '22 15:07 NicoZweifel

@NicoZweifel I build Debian 11 and Alpine 3.11 today to play around with it. I could craft them into your schema and make a pull on your fork. Would you be interested in that?

MichaelsJP avatar Jul 24 '22 18:07 MichaelsJP

@MichaelsJP Sounds good to me. Maybe we can add CentOS as well. #1608 contains a dev container for vscode based on CentOS.

NicoZweifel avatar Jul 25 '22 07:07 NicoZweifel

This PR did not work for me on macOS on ARM platform (MacBookPro with M1).

I think problem is that linuxbrew does not support aarch64 architecture by default. See https://docs.brew.sh/Homebrew-on-Linux#arm as well. There needs to be ruby 2.6.8_1 installed before installing linuxbrew. I was NOT able to successfully install ruby and linuxbrew to get it running. Any hints how to do that?

See me comment here as well: https://github.com/carbon-language/carbon-lang/pull/1608#issuecomment-1194181255

JochenHiller avatar Jul 25 '22 17:07 JochenHiller

I am unfamiliar with running docker on macOS on an ARM platform, a ARM based image would be a nice addition though i think. Have you tried putting --platform linux/amd64 as a run argument?

NicoZweifel avatar Jul 26 '22 07:07 NicoZweifel

Minimal version for what is required to run the current Carbon Explorer examples in Debian / Ubuntu containers without brew dep: - https://github.com/carbon-language/carbon-lang/issues/1732#issuecomment-1196025596

bozhodimitrov avatar Jul 26 '22 22:07 bozhodimitrov

Can you explain a bit more about the purpose of this PR? In particular, does this make it easier for people to start contributing to the Carbon project, or only make it easier for them to start using Carbon? I'm afraid I'm not very familiar with Docker.

geoffromer avatar Jul 28 '22 20:07 geoffromer

Both, but for working on carbon a dev container image for vscode is beeing added in #1608 . Not sure if it does make sense for this project yet to have multiple images and different base images (ubuntu, debian, CentOS) with a docker repository, since it is quite early. The main reasons are not having the required environment on your host machine to run/build carbon or if you want to use another specific environment for testing, isolation or other reasons.

NicoZweifel avatar Jul 30 '22 07:07 NicoZweifel

It looks like the base dockerfile shares a lot of the installs as the one in the .devcontainer. Do you think it'd maybe be reasonable to use the devcontainer as a base so there's only one "environment" dockerfile?

As for multi-os, does it seem reasonable to drop that for now? I'm thinking it's a bit unnecessary because there's only Explorer and Explorer doesn't really behave differently across operating systems.

junlarsen avatar Aug 02 '22 20:08 junlarsen

Yea i think you are correct. It is probably too early to maintain multiple docker images. The build system might also change in the future still i guess.

I can work the CentOS Dockerfile into the schema here, use it in the devcontainer and replace the ubuntu images with it when i find some time in the next few days.

NicoZweifel avatar Aug 04 '22 08:08 NicoZweifel

FYI I haven't forgotten this, but I'm having trouble finding someone who's able to review it.

geoffromer avatar Aug 08 '22 21:08 geoffromer

I can work the CentOS Dockerfile into the schema here, use it in the devcontainer and replace the ubuntu images with it when i find some time in the next few days.

CentOS was referring to an old version. It's currently using brew. I think ubuntu is a good direction though, and may try to cut the brew dependency myself in favor of an apt install (partly for features, partly for speed)

jonmeow avatar Sep 14 '22 22:09 jonmeow