Jump to content

What is docker and why developers need it?

mrchow19910319
Go to solution Solved by Cruorzy,

Docker is not only to have a seperate area for tesing it also provides.

 

- Same environment / software running on production / develop

Code will do exactly the same over the docker images, because all modules are activated you cant miss one or you are missing it on production too.

 

- Faster version switching of software, lets say if i want to go from php 7.0 to 7.1, that can be done quite fast.

 

- Setting up a development environment within seconds.

 

- Micromanage services, create individual containers for the types of software you use, PHP, MySQL, Nginx should create a nice Stack. 

I am seeing a lot of people talking about this. BUt I don't understand why,. Could someone who has a coding background tell me why exactly do we need VMs and containers when developing software and website? 

 

In my mind, what we do is :

  1. Write the code on our laptop/desktop.
  2. Upload the code to server.
  3. The server will transmit all of our code into user's laptop/desktop. 

So, why do we need VMs again? 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

VMs and docker are different things. 

 

Generally you would want to use a VM with docker on it for testing code to see if it causes issues. It lets you easily revert if something catastrophic happens. 

 

Once in use, Docker allows you to run various services using their own set of requirements at the version level that the dev has tested at without impacting other services running on the same machine. VMs in production allow hardware failure without having the server go down or with minimal impact at least. 

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, kerradeph said:

 

So to put it in a simpler way: 

 

We test our software in these bubbles we created that called: containers. 

All these bubbles are kind of isolated from our real OS on our desktop/laptops. 

So, if let's say our software messed up and fucked up the bubbles, it won't fuck up our own systems. 

 

Is this how it works? 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

Pretty much exactly it, yes. There are a few exceptions where the container/VM can impact or damage the host, but those are uncommon unless it's something you are specifically testing. 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, kerradeph said:

 

So if I write some shitty code in my software, and it is not running in containers/VMs, there is a chance that it will fuck up my own system? 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, mrchow19910319 said:

So if I write some shitty code in my software, and it is not running in containers/VMs, there is a chance that it will fuck up my own system? 

well depending on what your code is trying to do. all basic stuff will basically never impact your system. but once it becomes more advanced using hardware directly it becomes much easier to corrupt windows or just lock up the system.

Primary System

  • CPU
    Ryzen R6 5700X
  • Motherboard
    MSI B350M mortar arctic
  • RAM
    32GB Corsair RGB 3600MT/s CAS18
  • GPU
    Zotac RTX 3070 OC
  • Case
    kind of a mess
  • Storage
    WD black NVMe SSD 500GB & 1TB samsung Sata ssd & x 1TB WD blue & x 3TB Seagate
  • PSU
    corsair RM750X white
  • Display(s)
    1440p 21:9 100Hz
Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, SquintyG33Rs said:

well depending on what your code is trying to do. all basic stuff will basically never impact your system. but once it becomes more advanced using hardware directly it becomes much easier to corrupt windows or just lock up the system.

I see. Thanks! I remembered I saw some answer on quora that says if you want to freeze your system you should key in these command in your command prompt. LOL. Maybe one day I can fire up a VM and try it in ubuntu xD

 

If it is not broken, let's fix till it is. 

Link to comment
Share on other sites

Link to post
Share on other sites

There's also a test BSOD that you can trigger that will have the error cod 0xDEADDEAD.

 

But yes, you would need to be doing something pretty drastic to have lasting impact. Things like as stated interacting with hardware directly or also modifying files or the file system are where the term catastrophic becomes a concerning word to hear. 

Link to comment
Share on other sites

Link to post
Share on other sites

Docker is not only to have a seperate area for tesing it also provides.

 

- Same environment / software running on production / develop

Code will do exactly the same over the docker images, because all modules are activated you cant miss one or you are missing it on production too.

 

- Faster version switching of software, lets say if i want to go from php 7.0 to 7.1, that can be done quite fast.

 

- Setting up a development environment within seconds.

 

- Micromanage services, create individual containers for the types of software you use, PHP, MySQL, Nginx should create a nice Stack. 

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

Docker is a bad concept IMO. It might be "convenient" to just tuck everything into one giant container, but it should not be recommended to blindly open a container without knowing its contents. Software which is only supported as a "Docker installation" is fucked up in terms of security.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

@Dat Guy

But you dont tuck everything into a single container by start, and with software thats already prepared in a container is fine since there are Trusted repo's you can use.

If you dont trust them, make your own container.

 

Or am I missing your point?

Quote or mention me if not feel ignored 

Link to comment
Share on other sites

Link to post
Share on other sites

You are missing my point, which is: Containers take a lot of transparency and freedom off a software.

Write in C.

Link to comment
Share on other sites

Link to post
Share on other sites

Well it's certainly not for every task, but for others it might be even better too docker them up. unreliable software that have no alternatives or someone just wants that specific thing would be better in a docker container off. They are great for some stacks of software and great for most developers.

Quote or mention me if not feel ignored 

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

×