Weitere ähnliche Inhalte Ähnlich wie Persistence is futile (or is it?) - How to Manage, Version, and Promote Docker Volumes (20) Mehr von Leon Stigter (20) Kürzlich hochgeladen (20) Persistence is futile (or is it?) - How to Manage, Version, and Promote Docker Volumes5. • Developer Advocate
• Passionate about Serverless,
Containers, and all things
Cloud
• I love dadjokes, cheesecake
and Star Wars…
Who am i?
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
@LeonStigter
Leon Stigter, Developer Advocate
6. Who’s familiar with And who’s familiar with
Before we get into things though…
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
8. We’re big on pipelines and promotions concepts
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
CI
SERVER
Integration System Testing
If quality
requirments are hit
If quality
requirments are hit
If quality
requirments are hit
Staging
- Quality gates -
Production
1 2 3 4
*
9. What’s in my app container?
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved Image by Christo Anestev from Pixabay
10. What’s in my app container?
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
11. Data management in docker
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
Container
FileSystem
Bind mounts
tmpfs mounts
Memory
Volume mounts
docker run myContainer:1docker run -v ~/data:/data myContainer:1docker run --mount source=myvol2,target=/app myContainer:1
12. I don’t?
Container
file system
Host file
system
Docker
volumes
Where do you persist data?
Let’s address the whale in the room
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
13. • Created and managed by
Docker
• Usually stored on the Docker
host
• Accessible by multiple
containers at the same time
• No access to sensitive files*
• Available since early days of
Docker
• Can be any folder on the
host system
• Accessible by multiple
containers at the same time
• Accesses the host file
system
Bind mounts or volumes?
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
Volume Mounts Bind Mounts
14. • Share data between among
containers
• Decouple Docker host and
container runtime
• Store container data on a
different server
• Backup, restore, and
migration might be needed
• Never…
Bind mounts or volumes?
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
Choose volumes when Choose bind mounts when
15. • Share data between among
containers
• Decouple Docker host and
container runtime
• Store container data on a
different server
• Backup, restore, and
migration might be needed
• Share config data from host
to container
• Share build artifacts
(sources, jars, etc…)
• Folder structure is always
consistent
Bind mounts or volumes?
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
Choose volumes when Choose bind mounts when
16. The challenge
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
Docker images are amazing for managing software, but we
want to reuse the data and the configuration.
Where do we store that?
17. Should I choose Bind Mounts or Volumes
The challenge
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
19. We’re big on pipelines and promotions concepts
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
CI
SERVER
Integration System Testing
If quality
requirments are hit
If quality
requirments are hit
If quality
requirments are hit
Staging
- Quality gates -
Production
1 2 3 4
*
20. Okay, but what about a real-world use case?
Storing docker volumes
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved
24. Thank you!
Come by our booth G8!
@LeonStigter | Copyright © 2019 JFrog. All Rights Reserved