docker run hello-world
and get confirmation that everything is working, then you’re ready to proceed.
start.sh
. This Docker file can be saved, call it literally dockerfile
when you save it, and we’ll move on to creating the start.sh
script.
Again make a new file, and copy / paste in this code:
start.sh
file, and are going to place it into the Docker Hub in a Public repository. This is not secure, nor a best practice. However, if you use a Private repository, that would be fine. Or, even better, is to use a variable here and then provide that variable as an input to the Docker container creation, over in Azure. That methodology has the added advantage of quickly being able to switch among Edge Impulse projects simply by altering the variable. However, for demonstration purposes, we’ll leave this key in the start.sh
script, and proceed.
start.sh
. With our Dockerfile and the startup script, this container will connect to the Edge Impulse Studio as a camera device, so that we can begin taking pictures of apples, or for more enterprise deployments, collect data from the field. The goal at this point is still go collect data and build a high-quality dataset, and this container will start us on that path. We’re now ready to build the container, and then place it somewhere that Azure can reach it.
docker.io
is used here, as opposed to hub.docker.com
. Thus, you will use docker.io/YourUsernameThatYouCreated/edge-impulse-data-collection-container:v1.0
:
dockerfile
and start.sh
files we used in the last step, into the new folder. Open up the start.sh
script, and make one small (but important!) change. On the last time, change edge-impulse-linux
to edge-impulse-linux-runner
, like so:
start.sh
file here. When going to production and scaling enterprise applications, this is fine if you use a Private container repo, or even better is to replace this with a variable. But for demonstration purposes, we’ll go ahead and leave it in the script so you can see how it works. Next, we will do a similar Docker “build”, “image tag”, and “image push”, like we did previously. Specifically, from within this new directory with newly updated start.sh
, run the following commands:
docker.io/YourUsernameThatYouCreated/edge-impulse-runner-container:v1.0
. Then, click on “Container Create Options” and insert the same snippet we used earlier, which opens the port and sets the container to “Privileged” (again, recall, there are more secure ways of exposing only specific pieces of hardware, but for simplicity in this demo we’ll give it this access).
docker.io/YourUsernameThatYouCreated/edge-impulse-data-collection-container:v1.0
. Also as usual, click on “Container Create Options” and of course enter the same JSON snippet to open ports and set Privileged:
docker.io/YourUsernameThatYouCreated/edge-impulse-runner-container:v1.0
, click “Container Create Options”, and add the same JSON snippet we’ve been using: