Jump to content

Set maximum disk size of docker instance

babadoctor
Go to solution Solved by Eigenvektor,
1 minute ago, babadoctor said:

I see, so maybe  I shouldn't use docker.

 

What would you suggest I use?

Huh... But then how does google cloud do it? They have instances that they provision...

 

Would I be better off using something like kubernetes?

 

What software would you suggest I use for something like this?

For a machine with data that you want to keep and want to be able to log into to do work, something like VirtualBox, VMWare, KVM/QEMU is the better option. Create a virtual machine, install a Linux distro and then use it like you would a physical machine. Start it, install updates and programs you need, remote into it, work on whatever you want, shut it down.

 

A docker container is based on an image. An image usually contains only the essential stuff needed to provide the one service it was made for. The image itself is immutable. When you stop and restart the container it is back to its starting point (a bit like a snapshot + rollback in a virtual machine).

 

If you need a cluster, start multiple containers based on the same image. You do not install updates inside the container because they would be lost when the container is restarted. Instead you create a new image with the new version and replace the old container.

 

Think of Kubernetes like an additional management layer on top of containers (like Docker). Kubernetes is used to orchestrate multiple containers that work together (e.g. multiple services, each in its own container that depend on one another)

 

This is where companies like Amazon, Google and Microsoft come in: They provide a platform to run such containers which are then used to provide service(s) to customers. No one signs in to these machines directly to get work done. The machines are there to provide a service.

 

(And yes, they also provide other services like hosting so you can also run virtual machines on their platform in case you need a "real" machine)

How can I set the maximum size of a docker instance?

 

For example

 

docker run -it -d -p ubuntu bash

 

runs a docker instance, but how do i set the size?

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

My first question is why?

 

you should use a volume to store the data out side of the container.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, vorticalbox said:

My first question is why?

 

you should use a volume to store the data out side of the container.

I wanted to create an instance that would allow my friend to ssh into my docker container and run his code/programs

 

I didn't want to allow him to have too much space, though

 

Am I going about this wrong?

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, vorticalbox said:

My first question is why?

 

you should use a volume to store the data out side of the container.

I don't want the container to have access to overlay, is there any way to do this?

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

11 hours ago, babadoctor said:

I don't want the container to have access to overlay, is there any way to do this?

It sounds like you want a virtual machine more than a docker container. Docker containers are meant to be stateless. They run one service and all data is stored outside the container. If the container goes bad, you kill it and start a new instance. They are not meant to have things in them that is lost when the container is shut down.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, Eigenvektor said:

It sounds like you want a virtual machine more than a docker container. Docker containers are meant to be stateless. They run one service and all data is stored outside the container. If the container goes bad, you kill it and start a new instance. They are not meant to have things in them that is lost when the container is shut down.

Just to add to this, docker containera have layers, each step in your docker file is a new layer. 

 

When you start up your container it gets a new top layer were all file changes by your app goes. This layer is removed when the container is restarted, dies or is stopped. 

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, vorticalbox said:

Just to add to this, docker containera have layers, each step in your docker file is a new layer. 

 

When you start up your container it gets a new top layer were all file changes by your app goes. This layer is removed when the container is restarted, dies or is stopped. 

I see, so maybe  I shouldn't use docker.

 

What would you suggest I use?

5 hours ago, Eigenvektor said:

It sounds like you want a virtual machine more than a docker container. Docker containers are meant to be stateless. They run one service and all data is stored outside the container. If the container goes bad, you kill it and start a new instance. They are not meant to have things in them that is lost when the container is shut down.

Huh... But then how does google cloud do it? They have instances that they provision...

 

Would I be better off using something like kubernetes?

 

What software would you suggest I use for something like this?

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, babadoctor said:

I see, so maybe  I shouldn't use docker.

 

What would you suggest I use?

Huh... But then how does google cloud do it? They have instances that they provision...

 

Would I be better off using something like kubernetes?

 

What software would you suggest I use for something like this?

For a machine with data that you want to keep and want to be able to log into to do work, something like VirtualBox, VMWare, KVM/QEMU is the better option. Create a virtual machine, install a Linux distro and then use it like you would a physical machine. Start it, install updates and programs you need, remote into it, work on whatever you want, shut it down.

 

A docker container is based on an image. An image usually contains only the essential stuff needed to provide the one service it was made for. The image itself is immutable. When you stop and restart the container it is back to its starting point (a bit like a snapshot + rollback in a virtual machine).

 

If you need a cluster, start multiple containers based on the same image. You do not install updates inside the container because they would be lost when the container is restarted. Instead you create a new image with the new version and replace the old container.

 

Think of Kubernetes like an additional management layer on top of containers (like Docker). Kubernetes is used to orchestrate multiple containers that work together (e.g. multiple services, each in its own container that depend on one another)

 

This is where companies like Amazon, Google and Microsoft come in: They provide a platform to run such containers which are then used to provide service(s) to customers. No one signs in to these machines directly to get work done. The machines are there to provide a service.

 

(And yes, they also provide other services like hosting so you can also run virtual machines on their platform in case you need a "real" machine)

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Eigenvektor said:

For a machine with data that you want to keep and want to be able to log into to do work, something like VirtualBox, VMWare, KVM/QEMU is the better option. Create a virtual machine, install a Linux distro and then use it like you would a physical machine. Start it, install updates and programs you need, remote into it, work on whatever you want, shut it down.

 

A docker container is based on an image. An image usually contains only the essential stuff needed to provide the one service it was made for. The image itself is immutable. When you stop and restart the container it is back to its starting point (a bit like a snapshot + rollback in a virtual machine).

 

If you need a cluster, start multiple containers based on the same image. You do not install updates inside the container because they would be lost when the container is restarted. Instead you create a new image with the new version and replace the old container.

 

Think of Kubernetes like an additional management layer on top of containers (like Docker). Kubernetes is used to orchestrate multiple containers that work together (e.g. multiple services, each in its own container that depend on one another)

 

This is where companies like Amazon, Google and Microsoft come in: They provide a platform to run such containers which are then used to provide service(s) to customers. No one signs in to these machines directly to get work done. The machines are there to provide a service.

 

(And yes, they also provide other services like hosting so you can also run virtual machines on their platform in case you need a "real" machine)

I see. This explains a lot!

 

I hope that the other people who find this thread from google also learn that docker shouldn't be used for virtualization.

 

I will attempt to use OpenVZ to provision some space  and resources for my friend to run his code.

 

Thank you!

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×