This was inspired by this article:
https://realpython.com/pyscript-python-in-browser/
docker container stop pyscript ; docker container rm pyscript
This was inspired by this article:
https://realpython.com/pyscript-python-in-browser/
docker container stop pyscript ; docker container rm pyscript
Commands for creating a Docker container inspired by Data Science at the Command Line, 2nd Edition
# clean up namespace
docker container stop ds_cli ; docker container rm ds_cli
# run instance as service
docker container run -d -v /tmp/ds_cli:/tmp/ds_cli --name ds_cli ubuntu:22.04 sleep inf
# remove any existing Docker instance | |
docker container stop mongodb ; docker container rm mongodb | |
# start a Docker instance as a service | |
docker container run -d --name mongodb ubuntu:22.04 sleep inf | |
# install packages | |
docker container exec -i mongodb /bin/bash << 'eof' | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get update |
# === Subscriber and publisher in single container, eclipse broker | |
# remove any existing container | |
docker container stop mosquitto ; docker container rm mosquitto | |
# start the instance in the background ( and create an image, if needed ) | |
docker image list -a | grep -q mosquitto && | |
docker container run -d --name mosquitto mosquitto sleep inf || { |
# From: https://www.simplilearn.com/tutorials/docker-tutorial/raspberry-pi-docker | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
sudo sh get-docker.sh | |
sudo usermod -aG docker ${USER} | |
exec sudo su - ${USER} | |
docker image pull ubuntu:22.04 |
From https://www.mongodb.com/community/forums/t/installing-mongodb-over-ubuntu-22-04/159931/87
These commands were run using the bash shell on Debian 11 in the Linuv Dev Env on a Chromebook.
Make sure no mongodb instances exist
docker container stop mongodb ; docker container rm mongodb ; sleep 2
Run an Ubuntu 22.04 container in the background
# This should be turned into a multi-stage Dockerfile | |
docker container stop build_haskell ; docker container rm build_haskell ; sleep 1 | |
docker container run -d --name build_haskell ubuntu:20.04 sleep inf | |
<<'eof' docker container exec -i -w /tmp/ build_haskell /bin/bash | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get update | |
apt-get install -y vim tree jq file wget gcc g++ make xz-utils curl |
# Using a shell pipeline of awk, bc, sort, head in Docker with the Alpine image | |
<<'eof' docker container run --rm -i alpine | |
{ cat <<'eof2' | |
1000 | |
2000 | |
3000 | |
4000 |
# These commands were run using the bash shell on Debian 11 in the Linuv Dev Env on a Chromebook | |
# make sure no haskell instances exist | |
docker container stop haskell ; docker container rm haskell ; sleep 2 | |
# run an Ubuntu container in the background | |
docker container run -d --name haskell ubuntu:22.04 sleep inf | |
# install utilities and haskell | |
<<'eof' docker container exec -i haskell /bin/bash |
This file shows how one can configure a Docker instance to create a serverless function on Digital Ocean.
Rather than running doctl auth init ...
to set up a config.yaml file that holds the API token,
the container exec
command passes in an environment variable that contains the token.
In that way, the container never has the token on persistent storage.
That means the instance could be committed to an image without having credentials in the image.
It also means the commands in the Here-Doc could be used as as a template to create a Dockerfile in the future.
From DO function docs