-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepared base image with entrypoint. Sniffing already works ;-) Next step is to write a nice flask app to provide remote control by an rest interface
- Loading branch information
1 parent
92c250b
commit 376b084
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM arm32v7/python:3.6-jessie | ||
|
||
ENV RPIRF_VERSION 0.9.6 | ||
|
||
# Setup workdir | ||
ENV WORKDIR /rpi-433rc | ||
RUN mkdir -p ${WORKDIR} && \ | ||
cd ${WORKDIR} | ||
|
||
COPY ./entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
# Install necessary dependencies | ||
RUN pip3 install rpi-rf==${RPIRF_VERSION} | ||
|
||
# Install rest-api wrapper for rpi-rf | ||
# Not yet implemented | ||
|
||
# Entrypoint defaults to bash | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
CMD ["bash"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.PHONY: clean build | ||
|
||
RELEASE_IMAGE_NAME = rpi-433rc | ||
CURRENT_TAG = latest | ||
|
||
CONTAINER_NAME = rpi-433rc | ||
|
||
build: | ||
docker build -t $(RELEASE_IMAGE_NAME):$(CURRENT_TAG) . | ||
|
||
shell: build | ||
docker run -it --rm --name $(CONTAINER_NAME) --privileged --cap-add SYS_RAWIO --device=/dev/mem $(RELEASE_IMAGE_NAME):$(CURRENT_TAG) bash | ||
|
||
run: build | ||
docker run --rm --name $(CONTAINER_NAME) --privileged --cap-add SYS_RAWIO --device=/dev/mem $(RELEASE_IMAGE_NAME):$(CURRENT_TAG) | ||
|
||
sniff: build | ||
docker run --rm -it --name $(CONTAINER_NAME) --privileged --cap-add SYS_RAWIO --device=/dev/mem $(RELEASE_IMAGE_NAME):$(CURRENT_TAG) sniff | ||
|
||
clean: | ||
docker ps -a | grep '$(CONTAINER_NAME)' | awk '{print $$1}' | xargs docker rm | ||
if [ $(shell docker image inspect $(RELEASE_IMAGE_NAME):$(CURRENT_TAG) > /dev/null 2>/dev/null ; echo $$?) -eq 0 ] ; then docker rmi $(RELEASE_IMAGE_NAME):$(CURRENT_TAG) ; fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
case ${1} in | ||
sniff) | ||
shift | ||
exec rpi-rf_receive "$@" | ||
;; | ||
serve) | ||
echo "Serving via rest-api is not implemented" | ||
break | ||
;; | ||
*) | ||
exec "$@" | ||
;; | ||
esac | ||
|