# Accessing Zymbit API from Docker

**URL:** <https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679>\
**Category:** ZYMKEY4\
**Created:** [November 7, 2019, 4:45am UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679 "2019-11-07T04:45:07Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Albert](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Albert](https://community.zymbit.com/u/Albert)\
**Post date:** [November 7, 2019, 4:45am UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/1 "2019-11-07T04:45:07Z")

</div>

I would like to know if it is possible to access the Zymbit API, especially the encryption and decryption function from a Docker running in the PI with ZymKey Installed and activated.

If it is possible, what would I need to install in the docker to access the API? Thank you.

---

<div class="post-metadata">

**Author:** ![Albert](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Albert](https://community.zymbit.com/u/Albert)\
**Post date:** [November 14, 2019, 6:48am UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/2 "2019-11-14T06:48:28Z")

</div>

Another route that I am thinking to take is to have a simple REST api running on the Host OS of the PI to access the Zymbit Key. This would allow any programming language to have access to the Zymbit without being tied to a specific language implementation.

Does anyone has a sample app for accessing the C library for GoLang ?

---

<div class="post-metadata">

**Author:** ![mauricebizzarri](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.zymbit.com/mauricebizzarri/32/260_2.png) [@mauricebizzarri](https://community.zymbit.com/u/mauricebizzarri)\
**Post date:** [November 14, 2019, 11:14pm UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/3 "2019-11-14T23:14:02Z")

</div>

I have successfully accessed the C library from Golang. I have lots of sample code – I’m creating an entire secure infrastructure around the Zymbit key.

I have a sample app that I wrote just to learn how to access the C library. I’ll post it on github in a public repository and post the repository name.

Regards,

Maurice

Bizzarri Software

---

<div class="post-metadata">

**Author:** ![mauricebizzarri](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.zymbit.com/mauricebizzarri/32/260_2.png) [@mauricebizzarri](https://community.zymbit.com/u/mauricebizzarri)\
**Post date:** [November 14, 2019, 11:37pm UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/4 "2019-11-14T23:37:38Z")

</div>

go sample code - bizzarri/gozymkey  
git clone [https://github.com/bizzarri/gozymkey.git](https://github.com/bizzarri/gozymkey.git) should get you the sample go routine, a small shell script to help use it, and a README with sparse documentation. Enjoy. Happy to answer questions.

---

<div class="post-metadata">

**Author:** ![kevinzhang](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.zymbit.com/kevinzhang/32/275_2.png) [@kevinzhang](https://community.zymbit.com/u/kevinzhang)\
**Post date:** [November 15, 2019, 1:50am UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/5 "2019-11-15T01:50:32Z")

</div>

Thank you Maruicabizzarri, can you code run inside a docker container and still communicate with Zymbit module?

---

<div class="post-metadata">

**Author:** ![Albert](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Albert](https://community.zymbit.com/u/Albert)\
**Post date:** [November 15, 2019, 2:47am UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/6 "2019-11-15T02:47:00Z")

</div>

@mauricebizzarri Thank you for the sample Go code. Will do some testing.

---

<div class="post-metadata">

**Author:** ![Albert](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Albert](https://community.zymbit.com/u/Albert)\
**Post date:** [November 15, 2019, 2:51am UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/7 "2019-11-15T02:51:54Z")

</div>

If you can run the Zymbit access code in GoLang (with REST API) on the host. Then accessing the Zymbit from anywhere is possible. It is just a http/https REST API call.

---

<div class="post-metadata">

**Author:** ![kevinzhang](https://yyz1.discourse-cdn.com/flex027/user_avatar/community.zymbit.com/kevinzhang/32/275_2.png) [@kevinzhang](https://community.zymbit.com/u/kevinzhang)\
**Post date:** [November 15, 2019, 3:30am UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/8 "2019-11-15T03:30:00Z")

</div>

My question was can we run the GoLang code NOT on the host, but inside container. Yes, if it can run on host, REST API client can call from anywhere.

---

<div class="post-metadata">

**Author:** ![Albert](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@Albert](https://community.zymbit.com/u/Albert)\
**Post date:** [November 15, 2019, 5:21am UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/9 "2019-11-15T05:21:29Z")

</div>

I tried to install the libzk\_app\_utils library in a Docker but it has dependency on zkifc (started via systemd) and if i am not mistaken is the interface to the zymbit key. I am not sure if you can run more than one instance of the service.

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [November 15, 2019, 7:07am UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/10 "2019-11-15T07:07:05Z")

</div>

That’s correct. Only one instance of zkifc can be running on the system.

Having said that, I suppose it might be possible to copy the installed libzk\_app\_utils.so from the host into the docker container. If your container can communicate on localhost ports 9542 - 9546, then your application should be able to communicate with zkifc.

---

<div class="post-metadata">

**Author:** ![imanolgo](https://avatars.discourse-cdn.com/v4/letter/i/a6a055/32.png) [@imanolgo](https://community.zymbit.com/u/imanolgo)\
**Post date:** [June 30, 2021, 12:10pm UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/11 "2021-06-30T12:10:22Z")

</div>

Is there a way to communicate with the Zymkey using the Python API installed in the Docker container?

---

<div class="post-metadata">

**Author:** ![Bob\_of\_Zymbit](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@Bob\_of\_Zymbit](https://community.zymbit.com/u/Bob_of_Zymbit)\
**Post date:** [June 30, 2021, 5:38pm UTC](https://community.zymbit.com/t/accessing-zymbit-api-from-docker/679/12 "2021-06-30T17:38:03Z")

</div>

We have not done it ourselves but we have had customers report they have it working.
