docker build -f /path/to/Dockerfile -t repo.url.com:1234/username/reponame/containername:tag --build-arg CACHEBUST=$(date +%s) ./.
Ideally you should use a token created speficially for that use. Export your token as an environment variable:
export CR_PAT=YOUR_TOKEN
Then, log in to the registry using
echo $CR_PAT | docker login repo.url.com:1234 -u username --password-stdin
docker push repo.url.com:1234/username/reponame/containername:tag
docker run --gpus all -it -d -p 8080:8080 minedojo/minedojo:latest tail -f /dev/null
docker stop <running_container_id>
docker images
docker ps [- a]
The optional parameter -a shows containers who have been running, but have stopped, without -a it's just the running containers
docker exec -it <running_container_id> /bin/bash
Hint: When working with container ids, there is no need to copy the full id, only enough to make the id unique among the containers on the system
For instance, if I have two containers on my system with ids 9446123a7c1a0575e689623222b9df70d509715218e443c38fbc4e03029336d5
and 13fce77a7c84450a679caaaa6df030711010b3490dd5c86c627d08dc008d2b47
, I can get a shell on the latter container simply by executing:
docker exec -it 1 /bin/bash
since only one of the available containers has an id that starts with 1
.
docker run -t -i --rm --entrypoint bash repo.url.com:1234/username/reponame/containername:tag
docker cp /path/to/localfile <running_container_id>:/path/in/container/
docker run -t -i -v <host_dir>:<container_dir> ubuntu /bin/bash
(or you have filled the harddisk with lots of docker images and disk space is urgently needed)
docker system prune --all
cleans everything
docker container prune
removes just the stopped containers
''' docker run -p 8888:80 prakhar1989/static-site ''' Port 80 from the docker container is mapped to port 8888 of the system
sudo docker history --no-trunc repo.url.com:1234/username/reponame/containername | tac | tr -s ' ' | cut -d " " -f 5- | sed 's,^/bin/sh -c #(nop) ,,g' | sed 's,^/bin/sh -c,RUN,g' | sed 's, && ,\n & ,g' | sed 's,\s*[0-9]*[\.]*[0-9]*\s*[kMG]*B\s*$,,g' | head -n -1 >> backup_docckerfile.txt
#!/bin/bash
set -ex
BASE_DIR="$(git rev-parse --show-toplevel)"
REPO="$(git config --get remote.origin.url | sed 's/.*://;s/.git$//')"
REGISTRY="repo.url.com:1234"
docker build -f "${BASE_DIR}"/path/to/Dockerfile -t "${REGISTRY}"/"${REPO}":latest "${BASE_DIR}"/.
docker push "${REGISTRY}"/"${REPO}":latest