E3FC Fixes for Docker on Windows with WSL2 · Issue #299 · istopwg/ippsample · GitHub
[go: up one dir, main page]

Skip to content

Fixes for Docker on Windows with WSL2 #299

@AqeelMufthyHashim

Description

@AqeelMufthyHashim

Is your feature request related to a problem? Please describe.
I needed to be able to dockerise the application to run Windows, Mac, and Linux to test some print applications and server listeners we built. But the docker build and run kept failing.
The list of errors I encounter:

  1. Dockerfile COPY from windows to the image would make bash files fails as dos files are CRLF and unix expects LF.
  2. Dockerfile COPY needed to be followed by a chmod statement to make the appropriate files executable
  3. During the make process compiling with the necessary avahi libs kepy failing
  4. Docker on windows via WSL2 has really frustrating errors with systemd even with it enabled leading to issues with avahi-daemon and service management
  5. The ippserver is unuseable without port forwarding

Describe the solution you'd like
An updated Dockerfile with compatibility for Docker on windows via WSL2

  1. use sed to remove the carraige return and using chmod to make the appropriate files as executable
WORKDIR /root/ippsample
RUN find . -type f \( -name "config*" -o -name "install-sh*" \) -exec sed -i 's/\r$//' {} \;
RUN find . -type f \( -name "config*" -o -name "install-sh*" \) -exec chmod +x {} \;
  1. added libavahi-core-dev to list of packages
RUN apt-get install -y  mdns-scan libavahi-core-dev
  1. manually starting the avahi-daemon due to systemd issues
# Create entrypoint.sh script to start dbus and avahi-daemon
RUN echo '#!/bin/bash\n\
service dbus start\n\
avahi-daemon --no-chroot -D\n\
$*\n\
  1. run call to enable port forwarding, adding -p 0.0.0.0:631:631
docker run -it -p 0.0.0.0:631:631 ippsample ippserver -M mymanufacturer -l myloc -m model -n myhost -p 631 -s 72 -vvvv myserver

Additional context
I fully acknowledge that there might be a more appropriate way to do this.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestplatform-issueIssue is specific to an OS or desktop

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0