Skip to content

Commit

Permalink
Fix docker builds/compose (Issue #1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Sep 17, 2024
1 parent 9ddaa6d commit 6dd0c14
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
21 changes: 16 additions & 5 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
Creating an OpenPrinting CUPS Docker Image
==========================================


Prerequisites
-------------

- Install Docker on your system


Building and Running
--------------------
Building
--------

To build and run CUPS using Docker, follow these steps:
To build the CUPS Docker image, 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:
3. Run the following command to build the Docker image:

```
docker build .
```


Running
-------

1. To create and run a container with the CUPS image:

```
docker-compose up -d
```

4. To start interactive terminal in container
2. To start an interactive terminal in the container

```
docker exec -it cups /bin/bash
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ RUN apt-get install -y autoconf build-essential \
avahi-daemon libavahi-client-dev \
libssl-dev libkrb5-dev libnss-mdns libpam-dev \
libsystemd-dev libusb-1.0-0-dev zlib1g-dev \
sudo
openssl sudo

# Copy the current directory contents into the container's working directory
COPY . /root/cups
WORKDIR /root/cups
RUN ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var && make && make install
RUN ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var && make clean && make && make install

# Expose port 631 for CUPS web interface
EXPOSE 631
5 changes: 0 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ services:
# 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 \
Expand Down

0 comments on commit 6dd0c14

Please sign in to comment.