Trying to run a docker container from docker-py, but when I run:
client.containers.run(image='my/image:tag')
I get this error:
TypeError: sequence item 0: expected a bytes-like object, str found
Encoding to bytes with:
client.containers.run(image='my/image:tag'.encode())
Gives the error:
TypeError: b'my/image:tag' is not JSON serializable
I've tried going through the run function to see if there's a tag keyword, but as far as I can tell there's not.
Try running
images.list()
first and then useget
to get the required imageEx:
Then Run
This should give you exact image name.