Skip to content

Commit

Permalink
Add ubuntu notes
Browse files Browse the repository at this point in the history
  • Loading branch information
tuler committed Mar 2, 2023
1 parent 8825fd3 commit 318fb60
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 0 deletions.
37 changes: 37 additions & 0 deletions UBUNTU-NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Ubuntu

The [Cartesi](http://cartesi.io) team is interested in having python images built for `linux/riscv46` architecture, so it can be used as a base image for Cartesi DApps written in python.

Debian and buildpack-deps debian images, which are the base for the python image, are still unstable for `linux/riscv64` platform.

On the other hand Ubuntu and buildpack-deps ubuntu images already have official builds for `linux/riscv64`.

So this branch adds Ubuntu based variants for the `python` image.
A [PR was opened upstream](https://github.com/docker-library/python/pull/791), but its unlikely to be accepted.

In the meantime the Cartesi team is building the image and publishing as `cartesi/python`.

```shell
docker pull cartesi/python
```

## Building locally

The primary change introduced in this branch was to `versions.sh`, adding `jammy` and `kinetic` variants. The other changes are generated by executing the following command, which uses Docker so it works on any platform.

```shell
docker run -it --rm -v $(pwd):/app ubuntu
apt-get update
apt-get install -y curl gawk git jq wget
/app/update.sh
```

After running the command above several Dockerfiles are created or updated. The commands below build the images locally, using `dockerx` multi platform build.

```shell
docker buildx bake
```

> TODO: create a script to generate the [docker-bake.hcl](docker-bake.hcl) file from the [versions.json](versions.json) files.
Several tags are built, the main one is `docker.io/cartesi/python:jammy`.
80 changes: 80 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@

group "default" {
targets = ["v3_11-jammy"]
}

target "riscv" {
platforms = ["linux/riscv64"]
}

target "v3_7-jammy" {
inherits = ["riscv"]
context = "3.7/jammy/"
tags = ["docker.io/cartesi/python:3.7.16-jammy", "docker.io/cartesi/python:3.7-jammy"]
}

target "v3_8-jammy" {
inherits = ["riscv"]
context = "3.8/jammy/"
tags = ["docker.io/cartesi/python:3.8.16-jammy", "docker.io/cartesi/python:3.8-jammy"]
}

target "v3_9-jammy" {
inherits = ["riscv"]
context = "3.9/jammy/"
tags = ["docker.io/cartesi/python:3.9.16-jammy", "docker.io/cartesi/python:3.9-jammy"]
}

target "v3_10-jammy" {
inherits = ["riscv"]
context = "3.10/jammy/"
tags = ["docker.io/cartesi/python:3.10.10-jammy", "docker.io/cartesi/python:3.10-jammy"]
}

target "v3_11-jammy" {
inherits = ["riscv"]
context = "3.11/jammy/"
tags = ["docker.io/cartesi/python:3.11.2-jammy", "docker.io/cartesi/python:3.11-jammy", "docker.io/cartesi/python:3-jammy", "docker.io/cartesi/python:jammy"]
}

target "v3_12-jammy" {
inherits = ["riscv"]
context = "3.12-rc/jammy/"
tags = ["docker.io/cartesi/python:3.12.0a5-jammy", "docker.io/cartesi/python:3.12-rc-jammy"]
}

target "v3_7-kinetic" {
inherits = ["riscv"]
context = "3.7/kinetic/"
tags = ["docker.io/cartesi/python:3.7.16-kinetic", "docker.io/cartesi/python:3.7-kinetic"]
}

target "v3_8-kinetic" {
inherits = ["riscv"]
context = "3.8/kinetic/"
tags = ["docker.io/cartesi/python:3.8.16-kinetic", "docker.io/cartesi/python:3.8-kinetic"]
}

target "v3_9-kinetic" {
inherits = ["riscv"]
context = "3.9/kinetic/"
tags = ["docker.io/cartesi/python:3.9.16-kinetic", "docker.io/cartesi/python:3.9-kinetic"]
}

target "v3_10-kinetic" {
inherits = ["riscv"]
context = "3.10/kinetic/"
tags = ["docker.io/cartesi/python:3.10.10-kinetic", "docker.io/cartesi/python:3.10-kinetic"]
}

target "v3_11-kinetic" {
inherits = ["riscv"]
context = "3.11/kinetic/"
tags = ["docker.io/cartesi/python:3.11.2-kinetic", "docker.io/cartesi/python:3.11-kinetic", "docker.io/cartesi/python:3-kinetic", "docker.io/cartesi/python:kinetic"]
}

target "v3_12-kinetic" {
inherits = ["riscv"]
context = "3.12-rc/kinetic/"
tags = ["docker.io/cartesi/python:3.12.0a5-kinetic", "docker.io/cartesi/python:3.12-rc-kinetic"]
}

0 comments on commit 318fb60

Please sign in to comment.