How to configure the env vars , net name, exposed port and volumns when running a docker container in go sdk

Viewed 53

I'm trying to use the go SDK to run a docker container. In CLI, the docker can be run by

docker run -d \
-e myvar1=myval1 \
-e myvar2=myval2 \
--name=myname \
--hostname=myhost \
--net=mynet \
-p 12345:12345 -p 8080:8080  \
-v "my/path/to/data1"  \
-v "my/second-path/to/data2" \
mydocker/image_name:latest command1 \
command2 \
command3

I wonder how to find the go SDK equivalent for this cli command. I referred to this post but I'm still confused about the setting for env vars, network, columns and also multiple exposed ports.

1 Answers
Related