Docker certificate has expired or is not yet valid - Shuang0420/Shuang0420.github.io GitHub Wiki

错误

$ docker run -it -p 8088:8088 -p 8042:8042 -p 4040:4040 -h sandbox sequenceiq/spark:1.6.0 bash
An error occurred trying to connect: Post https://192.168.59.103:2376/v1.20/containers/create: x509: certificate has expired or is not yet valid

解决

$ boot2docker stop
$ boot2docker delete
$ boot2docker init
$ boot2docker up

然后

$ docker run -it -p 8088:8088 -p 8042:8042 -p 4040:4040 -h sandbox sequenceiq/spark:1.6.0 bash
Unable to find image 'sequenceiq/spark:1.6.0' locally
1.6.0: Pulling from sequenceiq/spark
89b52f216c6c: Pulling fs layer
0dd5f7a357f5: Pulling fs layer
ae2537991743: Pulling fs layer
b38f87063c35: Pulling fs layer
36bf8ea12ad2: Pulling fs layer
...

成功~

参考链接: boot2docker(v 1.4.1 and 1.5) bad cert issues on OSX 10.9.3