ct-Open-Source / ct-Open-Source/tuya-convert
Alternative Dockerfile
- Dominant language
- Python
- Stars
- 5.1k
- Forks
- 523
- PR merge metrics
- No merged PRs in 30d
Description
I'm a little braindead today and didn't notice the project includes a Dockerfile before I'd gone ahead a rolled my own. It's simpler and builds the image *much* faster than the Ubuntu image you use currently so I thought I'd share in case it's of interest. Feel free to ignore this if not. There was only one hack to the existing project code needed to get it to work; busybox's `ls` doesn't support the `-m` option.
```Dockerfile
FROM alpine:latest
RUN apk add --update bash git iw dnsmasq hostapd screen curl py3-pip py3-wheel python3-dev mosquitto haveged net-tools openssl openssl-dev gcc musl-dev linux-headers sudo
RUN python3 -m pip install --upgrade paho-mqtt tornado git+https://github.com/drbild/sslpsk.git pycryptodomex
RUN git clone --depth 1 https://github.com/ct-Open-Source/tuya-convert /usr/local/tuya-convert
RUN sed -i 's|ls -m|ls|' /usr/local/tuya-convert/scripts/setup_checks.sh
WORKDIR "/usr/local/tuya-convert"
```
A companion Makefile too...
```Makefile
NAME="tuya-convert"
EXEC ?= /bin/sh
run:
@if [ "$(shell docker ps -q -f "name=$(NAME)")" = "" ] ; then \
docker build --tag $(NAME) .; \
docker run --rm -it --network=host --name=$(NAME) --privileged $(NAME) $(EXEC); \
else \
docker exec -it $(NAME) $(EXEC); \
fi
clean:
@[ "$(shell docker ps -q -f "name=$(NAME)")" = "" ] || docker stop $(NAME)
@docker rmi $(NAME)
.PHONY: run clean
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.