Skip to content

Instantly share code, notes, and snippets.

@eldondev
Last active June 1, 2022 16:59
Show Gist options
  • Save eldondev/d73aaa4ea6d1323c5475da4f02f74489 to your computer and use it in GitHub Desktop.
Save eldondev/d73aaa4ea6d1323c5475da4f02f74489 to your computer and use it in GitHub Desktop.
zxing dockerfile
FROM java
RUN wget https://oss.sonatype.org/content/repositories/snapshots/com/google/zxing/javase/3.2.2-SNAPSHOT/javase-3.2.2-20151101.162926-3.jar
RUN wget https://oss.sonatype.org/content/repositories/snapshots/com/google/zxing/core/3.2.2-SNAPSHOT/core-3.2.2-20151101.162918-3.jar
RUN wget https://repo1.maven.org/maven2/com/beust/jcommander/1.48/jcommander-1.48.jar
ENTRYPOINT ["java","-cp", "core-3.2.2-20151101.162918-3.jar:javase-3.2.2-20151101.162926-3.jar:jcommander-1.48.jar", "com.google.zxing.client.j2se.CommandLineRunner"]
#!/bin/sh
#Run like this
set -e
if [ ! -f IMG.jpg ] ; then echo "The image file to convert doesn't exist!" && exit 1 ; fi
docker build -t zxing .
docker run --net=none -v $PWD/IMG.jpg:/IMG.jpg --rm zxing --try_harder file:///IMG.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment