embedme is a great tool to keep external scripts in-sync with your docs.
*.md {
prep +onchange: "npx embedme *.md"
}
*.py {
prep +onchange: "black ."
}
FROM python:3.7
COPY hello.py /
CMD [ "python", "/hello.py" ]
def main():
print("oh hai")
if __name__ == "__main__":
main()
So from the command line, to build this image, you'd run:
$ docker build . -t oh-hai
To run this image, you'd run:
$ docker run -it --rm oh-hai