curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable test"
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io
sudo adduser $(whoami) docker
FROM ubuntu:xenial
RUN apt update && apt install -y nginx
EXPOSE 80
COPY . /var/www/html
CMD ["nginx", "-g", "daemon off;"]
<html>
<head>
<title>Raspberry Kubernetes</title>
</head>
<body>
<h1>My static web site running on Raspberry Kubernetes</h1>
</body>
</html>
docker build -t <replace by your image name> .
ie: docker build -t some-content-nginx .
Note the point at the end is important dont delete
docker images
You should be able to see you image listed.
REPOSITORY TAG IMAGE ID CREATED SIZE
my-nginx v1.0 4e3c3cfc6dbf 12 minutes ago 205MB
some-content-nginx latest 4e3c3cfc6dbf 12 minutes ago 205MB
ubuntu xenial 56bab49eef2e 7 days ago 123MB
docker run --name some-nginx -d -p 8080:80 some-content-nginx
Note the name of the image is at the end.
docker ps -a
Use name for docker stop [container name
go to http://localhost:8080/
and you should be able to see the index.html content displayed
Login into your docker account, if you dont have create one
Create a private repository
docker login -u "username" -p "password" docker.io
The tagname should be identical to your respository ie:
sudo docker tag some-content-nginx:latest crhostservices/custom_nginx:latest
See the crhostservices/custom_ngnix
docker tag local-image:tagname new-repo:tagname
if you run:
docker images
You should see your tag image
same case here , push the image with the whole repository name
docker push new-repo:tagname
If you dont use the full repository name, you will get an error "requested access to resource is denied"
docker rmi -f [image_id]
Note: if you are trying to remove a image and is in use by a container you will get an error like this
image is being used by running container xxx
so you will need to stop container first, see below
docker ps -a
It will show all containers
without -a will show only running containers
get the container_id to stop
docker stop [container_id]
docker pull crhostservices/custom_nginx:latest
Need to specify full repository
Please note you need to make it public or login if it's private
Go to run image example , to make it available on localhost.
you may need to loing in docker.
kubectl run <YOUR_DEPLOYMENT_NAME> --image=docker.io/$docker_username/<YOUR_PUBLIC_REPO_IMAGE_NAME>:<TAG>
Good repository for arm images - ARM is the processor of Pi, so images must comply with this standard
https://github.com/alexellis/docker-arm/tree/master/images/armhf