refactor: restructure repository

This commit is contained in:
pataar 2022-02-26 17:02:25 +01:00
parent bd527176bb
commit 8b1f5dab49
7 changed files with 6 additions and 15 deletions

View File

@ -13,18 +13,10 @@ RUN apt-get update && apt-get install -y \
build-essential \ build-essential \
cmake \ cmake \
gcc-avr \ gcc-avr \
### moonraker
curl \
iproute2 \
libcurl4-openssl-dev \ libcurl4-openssl-dev \
libjpeg-dev \
liblmdb-dev \
libopenjp2-7 \
libsodium-dev \
libssl-dev \ libssl-dev \
python3-dev \ python3-dev \
python3-libgpiod \ python3-libgpiod \
zlib1g-dev \
### clean up ### clean up
&& apt-get -y autoremove \ && apt-get -y autoremove \
&& apt-get clean \ && apt-get clean \
@ -39,7 +31,7 @@ RUN git clone https://github.com/klipper3d/klipper && \
/build/klippy-env/bin/pip install -r /build/klipper/scripts/klippy-requirements.txt /build/klippy-env/bin/pip install -r /build/klipper/scripts/klippy-requirements.txt
#### Simulavr #### Simulavr
COPY docker/simulavr.config /usr/src COPY config/simulavr.config /usr/src
RUN git clone -b master git://git.savannah.nongnu.org/simulavr.git && \ RUN git clone -b master git://git.savannah.nongnu.org/simulavr.git && \
# Build the firmware # Build the firmware
cd klipper && \ cd klipper && \
@ -88,9 +80,9 @@ RUN groupadd --force -g 1000 printer \
&& echo 'printer ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers.d/printer && echo 'printer ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers.d/printer
### copy all required files ### copy all required files
COPY docker/supervisord.conf /etc/supervisor/supervisord.conf COPY config/supervisord.conf /etc/supervisor/supervisord.conf
COPY docker/start.sh /bin/start COPY scripts/start.sh /bin/start
COPY docker/service_control.sh /bin/service_control COPY scripts/service_control.sh /bin/service_control
### make entrypoint executable ### make entrypoint executable
RUN chmod +x /bin/start RUN chmod +x /bin/start
@ -99,7 +91,6 @@ RUN chmod +x /bin/service_control
USER printer USER printer
WORKDIR /home/printer WORKDIR /home/printer
# Copy our prebuilt applications from the builder stage # Copy our prebuilt applications from the builder stage
COPY --from=builder --chown=printer:printer /build/klippy-env ./klippy-env COPY --from=builder --chown=printer:printer /build/klippy-env ./klippy-env
COPY --from=builder --chown=printer:printer /build/klipper/ ./klipper/ COPY --from=builder --chown=printer:printer /build/klipper/ ./klipper/

View File

@ -29,4 +29,4 @@ Klipper, Moonraker and a simulated Atmel ATmega micro-controller now run inside
The container is build in a way, that you are able to quickly "re-install" Klipper and Moonraker or can quickly re-build the python environments or the firmware if that is ever necessary. For that, simply delete the corresponding folder/file and restart the container and the required components will be "installed" again. The container is build in a way, that you are able to quickly "re-install" Klipper and Moonraker or can quickly re-build the python environments or the firmware if that is ever necessary. For that, simply delete the corresponding folder/file and restart the container and the required components will be "installed" again.
Feel free to contribute if you find solutions to make the docker image even smaller (~ 679 MB as of now) or provide ideas to generally improve this project. Feel free to contribute if you find solutions to make the docker image even smaller (~679 MB as of now) or provide ideas to generally improve this project.

View File

@ -4,7 +4,7 @@ services:
container_name: printer container_name: printer
build: build:
context: . context: .
dockerfile: docker/Dockerfile dockerfile: Dockerfile
volumes: volumes:
- ./printer_storage/.moonraker_database:/home/printer/.moonraker_database:delegated - ./printer_storage/.moonraker_database:/home/printer/.moonraker_database:delegated
- ./printer_storage/gcode_files:/home/printer/gcode_files:delegated - ./printer_storage/gcode_files:/home/printer/gcode_files:delegated