99
1010 "github.com/algo7/TripAdvisor-Review-Scraper/container_provisioner/database"
1111 "github.com/algo7/TripAdvisor-Review-Scraper/container_provisioner/utils"
12-
13- "github.com/docker/docker/api/types"
1412 "github.com/docker/docker/api/types/container"
13+ "github.com/docker/docker/api/types/image"
1514 "github.com/docker/docker/api/types/network"
1615 "github.com/docker/docker/client"
1716)
@@ -29,12 +28,12 @@ func initializeDockerClient() *client.Client {
2928}
3029
3130// PullImage pulls the given image from a registry
32- func PullImage (image string ) {
31+ func PullImage (imageName string ) {
3332 cli , err := client .NewClientWithOpts (client .FromEnv , client .WithAPIVersionNegotiation ())
3433 utils .ErrorHandler (err )
3534 defer cli .Close ()
3635
37- reader , err := cli .ImagePull (context .Background (), image , types. ImagePullOptions {})
36+ reader , err := cli .ImagePull (context .Background (), imageName , image. PullOptions {})
3837 utils .ErrorHandler (err )
3938 defer reader .Close ()
4039
@@ -50,7 +49,7 @@ func RemoveContainer(containerID string) {
5049 defer cli .Close ()
5150
5251 // Remove the container
53- err = cli .ContainerRemove (context .Background (), containerID , types. ContainerRemoveOptions {
52+ err = cli .ContainerRemove (context .Background (), containerID , container. RemoveOptions {
5453 RemoveVolumes : true ,
5554 Force : true ,
5655 })
@@ -116,7 +115,7 @@ func TailLog(containerID string) io.Reader {
116115 defer cli .Close ()
117116
118117 // Print the logs of the container
119- out , err := cli .ContainerLogs (context .Background (), containerID , types. ContainerLogsOptions {
118+ out , err := cli .ContainerLogs (context .Background (), containerID , container. LogsOptions {
120119 ShowStdout : true ,
121120 Details : true ,
122121 ShowStderr : false ,
@@ -160,7 +159,7 @@ func ListContainersByType(containerType string) []Container {
160159 defer cli .Close ()
161160
162161 // List all containers
163- containersInfo , err := cli .ContainerList (context .Background (), types. ContainerListOptions {All : false })
162+ containersInfo , err := cli .ContainerList (context .Background (), container. ListOptions {All : false })
164163 utils .ErrorHandler (err )
165164
166165 // Create a slice of Container structs
0 commit comments