| 
									
										
										
										
											2017-02-11 00:48:15 +08:00
										 |  |  | package buildah | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-10-03 22:05:46 +08:00
										 |  |  | import ( | 
					
						
							|  |  |  | 	"github.com/pkg/errors" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-24 01:32:16 +08:00
										 |  |  | // Unmount unmounts a build container.
 | 
					
						
							| 
									
										
										
										
											2017-02-11 00:48:15 +08:00
										 |  |  | func (b *Builder) Unmount() error { | 
					
						
							| 
									
										
										
										
											2018-07-18 23:49:09 +08:00
										 |  |  | 	_, err := b.store.Unmount(b.ContainerID, false) | 
					
						
							| 
									
										
										
										
											2018-10-03 22:05:46 +08:00
										 |  |  | 	if err != nil { | 
					
						
							|  |  |  | 		return errors.Wrapf(err, "error unmounting build container %q", b.ContainerID) | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	b.MountPoint = "" | 
					
						
							|  |  |  | 	err = b.Save() | 
					
						
							|  |  |  | 	if err != nil { | 
					
						
							|  |  |  | 		return errors.Wrapf(err, "error saving updated state for build container %q", b.ContainerID) | 
					
						
							| 
									
										
										
										
											2017-02-11 00:48:15 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-10-03 22:05:46 +08:00
										 |  |  | 	return nil | 
					
						
							| 
									
										
										
										
											2017-02-11 00:48:15 +08:00
										 |  |  | } |