-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple Dockerfile returning python version
- Loading branch information
1 parent
6459d73
commit 5e18eb8
Showing
2 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import sys | ||
import anyio | ||
import dagger | ||
|
||
|
||
async def test(): | ||
async with dagger.Connection(dagger.Config(log_output=sys.stderr)) as client: | ||
|
||
# ------------------------------------------------------------------------- | ||
# EXAMPLE DOCKERFILE | ||
# ------------------------------------------------------------------------- | ||
# | ||
# FROM python:3.11-slim-buster | ||
# | ||
# CMD [ "python", "-V"] | ||
# | ||
# ------------------------------------------------------------------------- | ||
|
||
python = ( | ||
client.container() | ||
# pull container | ||
.from_("python:3.11-slim-buster") | ||
# get Python version | ||
.with_exec(["python", "-V"]) | ||
) | ||
|
||
# execute | ||
version = await python.stdout() | ||
|
||
print(f"Hello from Dagger and {version}") | ||
|
||
if __name__ == "__main__": | ||
anyio.run(test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
# dagger_io_python | ||
A programmable CI/CD engine that runs your pipelines in containers | ||
# Dagger CI/CD (Python) | ||
|
||
<img src="https://dagger.io/logo.svg" width="100"> | ||
|
||
---- | ||
|
||
## Descripción | ||
|
||
Un motor de CI/CD programable que ejecutar sus pipelines en contenedores | ||
|
||
## Tabla de contenidos | ||
- [01-Dagger-Client](01-Dagger-Client) |