Docker for algorand algod+node
Objective#
have a docker file and host the infrastructure of AlgoBuilder, which requirers algod and goal
Record#
Restart learning docker with video Docker Tutorial for Beginners [FULL COURSE in 3 Hours]. 43:28: binded -> bound.
- Image := source code how to build the docker (dockerfile), all images on DockerHub are images.
- Container := a copy/image of the "installed" app. with port bound and virtual file system.
Docker CLI#
docker run: build container from image; pull image if needed. flag -d: detached mod (not starting), -p: port, -i interactive, --name: name for container.
docker start: start container. Normally, data will not persist between starts. Need use docker volumes for data persistence.
docker exec: start a function (run a command) in container, will start if container is not stated.
docker-compose -f: same as running it in command line with docker run but easier to reuse, with a docker network already set up. The network is created with up and will be removed when down.
Dockerfile: a file that contains the instructions for building the image.RUN and CMD are both Linux command but CMD is the entry point of the image. Has to be named Dockerfile with capital D.
docker build: build image from Dockerfile.
docker rm: remove container.
docker rmi: remove image.
docker tag: rename image.
docker login, docker push, docker pull: login, push, pull image from DockerHub or other private docker repository.
docker volumes: Host volumes docker run -v /host/path:/container/path; Anonymous volumes docker run -v /host/path; Named volumes docker run -v $SOME_NAME:/host/path;
run amd64 docker image on M1#
[Docker platform on M1](./Docker platform on M1.md)
Plan#
- Use Alpine. / ubuntu. check size. 3M vs 30M. Using Alpine. (supported by node)
- Use go + Alpine (golang:alpine)
- Alpine "cannot execute binary"
- Testing ubuntu
code record#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
dockerfile#
1 2 3 4 5 6 | |