--- /dev/null
+# Include any files or directories that you don't want to be copied to your
+# container here (e.g., local build artifacts, temporary files, etc.).
+#
+# For more help, visit the .dockerignore file reference guide at
+# https://docs.docker.com/go/build-context-dockerignore/
+
+**/.DS_Store
+**/__pycache__
+**/.venv
+**/.classpath
+**/.dockerignore
+**/.env
+**/.git
+**/.gitignore
+**/.project
+**/.settings
+**/.toolstarget
+**/.vs
+**/.vscode
+**/*.*proj.user
+**/*.dbmdl
+**/*.jfm
+**/bin
+**/charts
+**/docker-compose*
+**/compose*
+**/Dockerfile*
+**/node_modules
+**/npm-debug.log
+**/obj
+**/secrets.dev.yaml
+**/values.dev.yaml
+LICENSE
+README.md
+container-config
/vcnet/x64
/xcode/CUPS.xcodeproj/project.xcworkspace/
/xcode/CUPS.xcodeproj/xcuserdata/
-
+.DS_store
+container-config
\ No newline at end of file
--- /dev/null
+# syntax=docker/dockerfile:1
+
+# Use the latest Ubuntu base image
+FROM ubuntu:latest
+
+# Set the working directory inside the container
+WORKDIR /workspaces/cups
+
+# Update package list and upgrade existing packages
+RUN apt-get update -y && apt-get upgrade -y
+
+# Install required dependencies for CUPS
+RUN apt-get install -y \
+ autoconf \
+ build-essential \
+ libavahi-client-dev \
+ libgnutls28-dev \
+ libkrb5-dev \
+ libnss-mdns \
+ libpam-dev \
+ libsystemd-dev \
+ libusb-1.0-0-dev \
+ zlib1g-dev \
+ openssl \
+ sudo
+
+# Copy the current directory contents into the container's working directory
+COPY . .
+
+# Expose port 631 for CUPS web interface
+EXPOSE 631
the messages to stderr. Prefix a filename with "+" to append to an existing
file. You can include a single "%d" in the filename to embed the current
process ID.
+
+Build Using Docker
+------------------
+
+### Prerequisites
+
+- Docker installed on your system
+
+### Build and Run
+
+To build and run CUPS using Docker, follow these steps:
+
+1. Clone this repository to your local machine.
+
+2. Navigate to the root directory of the cloned repository.
+
+3. Run the following command to start the Docker containers in the background:
+
+ ```bash
+ docker-compose up -d
+ ```
+
+4. To start interactive terminal in container
+ ```bash
+ docker exec -it cups /bin/bash
+ ```
--- /dev/null
+version: "3.8"
+
+services:
+ cups:
+ build:
+ context: .
+ dockerfile: Dockerfile
+ container_name: cups
+ # Command to be executed when the container starts
+ command:
+ - /bin/bash
+ - -c
+ - |
+ # Add a new user 'admin' with password 'admin'
+ useradd -m --create-home --password $(echo 'admin' | openssl passwd -1 -stdin) -f 0 admin
+
+ # Create a new group 'lpadmin'
+ groupadd lpadmin
+
+ # Add the user 'admin' to the 'lpadmin' group
+ usermod -aG lpadmin admin
+
+ # Grant sudo privileges to the user 'admin'
+ echo 'admin ALL=(ALL:ALL) ALL' >> /etc/sudoers
+
+ # build CUPS
+ ./configure
+ make
+ make install
+
+ # Start the CUPS daemon for remote access
+ /usr/sbin/cupsd \
+ && while [ ! -f /var/run/cups/cupsd.pid ]; do sleep 1; done \
+ && cupsctl --remote-admin --remote-any --share-printers \
+ && kill $(cat /var/run/cups/cupsd.pid) \
+ && echo "ServerAlias *" >> /etc/cups/cupsd.conf \
+ && service cups start \
+ && /usr/sbin/cupsd -f
+
+ # Expose port 631 for CUPS web interface
+ ports:
+ - "631:631"
+
+ # Bind mount for cups config files and logs
+ volumes:
+ - .:/workspaces/cups
+ - ./container-config:/etc/cups
+ - ./container-config/logs:/var/log/cups