scottw Posted August 12, 2023 Share Posted August 12, 2023 (edited) Hello. I am a bit over my head here and could use some help. I created a SQL Server 2019 docker by following these instructions: https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker?view=sql-server-ver15&pivots=cs1-bash Everything has been working great for a couple of years now. I am now learning more and realized I increased my docker image to a size too big (and wasteful) due to my lack of knowledge. I would now like to size that docker image down and know how to do it the preferred way. Since this docker container was not created through Community Apps, I would have to do it from scratch....not a problem. I would however like to save the DB inside of that container. I can connect to that DB with SQL Server Management Studio but have no idea how to backup the DB OUTSIDE of the docker container...LOL I realize this should be simple but I am just not up to speed with all of that yet...but am learning. I understand how the Volume Mapping works but it appears my docker container does not have any mapped. Is this something I could do manually to accomplish what I want to accomplish or is there and easier way. Like I said, I just need to be able to backup my Sql DB somewhere safe so I can restore it after I recreate the Docker.img file. Here is the container, if that helps: Thanks, Scott Edited August 12, 2023 by scottw Quote Link to comment
JonathanM Posted August 13, 2023 Share Posted August 13, 2023 Theoretically you should be able to add a path mapping with the container side pointed to a convenient folder like /backup and the host side pointed to /mnt/user/appdata/sql or something like that, then execute the backup inside the container pointed at /backup and the files should show up in /mnt/user/appdata/sql. Quote Link to comment
scottw Posted August 13, 2023 Author Share Posted August 13, 2023 Yeah, exactly what I was thinking but have no idea how to do that. I know how to do it by editing a “Community Apps” docker but not this one, it just just allows me to get to the console. any idea how to do that or somewhere I can read up on that? Thanks, Scott Quote Link to comment
Solution scottw Posted August 13, 2023 Author Solution Share Posted August 13, 2023 Just to follow up in case it helps someone else. I was able to use the docker cp command to copy from the container to the local filesystem. Worked perfectly! Scott Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.