don't even know, I will organize later
This commit is contained in:
@@ -4,17 +4,11 @@ FROM alpine:20231219
|
||||
ENV TZ="Europe/Lisbon"
|
||||
|
||||
|
||||
# Install the required packages
|
||||
RUN apk --no-cache add bash zsh go make \
|
||||
&& rm -rf /tmp/*
|
||||
|
||||
|
||||
# Copy the source files
|
||||
COPY ../src /printer-src
|
||||
|
||||
|
||||
# Add the entrypoint
|
||||
USER $UNAME
|
||||
COPY ./start.sh /start.sh
|
||||
STOPSIGNAL SIGTERM
|
||||
ENTRYPOINT [ "/start.sh" ]
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
build:
|
||||
docker buildx build -t thprinter .
|
||||
include vars.mk
|
||||
|
||||
image = $(registry)/$(repo)/$(name):$(tag)
|
||||
|
||||
build_image:
|
||||
make -B -C src build
|
||||
podman buildx build -t $(image) .
|
||||
|
||||
push_image:
|
||||
podman push $(image)
|
||||
|
||||
clean:
|
||||
docker container rm thprinter-container-test --force
|
||||
podman container rm thprinter-container-test --force
|
||||
|
||||
attach:
|
||||
docker exec -u root -it thprinter-container zsh
|
||||
podman exec -u root -it thprinter-container zsh
|
||||
|
||||
attach-test:
|
||||
docker exec -u root -it thprinter-container-test zsh
|
||||
podman exec -u root -it thprinter-container-test zsh
|
||||
|
||||
test: clean
|
||||
docker run \
|
||||
podman run \
|
||||
--name thprinter-container-test \
|
||||
-p 9099:9099 \
|
||||
-it thprinter zsh
|
||||
|
||||
@@ -40,6 +40,16 @@ Copy the `capabilities.json` file you generated into the `src` directory of this
|
||||
project.
|
||||
|
||||
|
||||
## How to find the printer
|
||||
On my specific printer:
|
||||
- turn off
|
||||
- hold the feed button
|
||||
- turn it on
|
||||
- hold the feed button until the lights blink red
|
||||
- release button
|
||||
- test page will print with network settings
|
||||
|
||||
|
||||
## Running it
|
||||
Go to the `src` directory and try it with:
|
||||
`$ echo "Something, something" | go run .`
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
build:
|
||||
build: clean
|
||||
mkdir build
|
||||
CGO_ENABLED=1 GOOS=linux CC=musl-gcc \
|
||||
go build -o build/printer
|
||||
cp ./capabilities.json ./build/
|
||||
cp ./config.yaml ./build/
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# echo "nameserver 8.8.8.8" >> /etc/resolv.conf
|
||||
|
||||
if [ ! -d /printer ]; then
|
||||
export GOPROXY="https://goproxy.io"
|
||||
cd /printer-src
|
||||
make clean
|
||||
make build
|
||||
mv build /printer
|
||||
cd ..
|
||||
rm -r /printer-src
|
||||
fi
|
||||
|
||||
cd /printer
|
||||
exec ./printer server
|
||||
|
||||
Reference in New Issue
Block a user