mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
update
This commit is contained in:
29
cue.mod/pkg/universe.dagger.io/python/python.cue
generated
Executable file
29
cue.mod/pkg/universe.dagger.io/python/python.cue
generated
Executable file
@@ -0,0 +1,29 @@
|
||||
// Helpers to run python programs
|
||||
package python
|
||||
|
||||
import (
|
||||
"universe.dagger.io/docker"
|
||||
|
||||
"universe.dagger.io/alpine"
|
||||
)
|
||||
|
||||
// Run a python script in a container
|
||||
#Run: {
|
||||
// Contents of the python script
|
||||
script: string
|
||||
|
||||
// FIXME: don't pass the script as argument: write to filesystme instead
|
||||
docker.#Run & {
|
||||
command: {
|
||||
name: "python"
|
||||
flags: "-c": script
|
||||
}
|
||||
|
||||
// As a convenience, image defaults to a ready-to-use python environment
|
||||
image: docker.#Image | *_defaultImage
|
||||
|
||||
_defaultImage: alpine.#Image & {
|
||||
packages: python: version: "3"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user