diff --git a/ykman/Dockerfile b/ykman/Dockerfile index 7a50108..6d1c253 100644 --- a/ykman/Dockerfile +++ b/ykman/Dockerfile @@ -10,6 +10,7 @@ FROM ubuntu:16.04 LABEL maintainer "Jessie Frazelle " RUN apt-get update && apt-get install -y \ + pcscd \ software-properties-common \ --no-install-recommends && \ add-apt-repository ppa:yubico/stable && \ @@ -17,6 +18,11 @@ RUN apt-get update && apt-get install -y \ yubikey-manager \ && rm -rf /var/lib/apt/lists/* +ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 + WORKDIR /root/ +COPY entrypoint.sh /usr/local/bin/ + +ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] CMD [ "ykman", "--help" ] diff --git a/ykman/entrypoint.sh b/ykman/entrypoint.sh new file mode 100755 index 0000000..fe72a9d --- /dev/null +++ b/ykman/entrypoint.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e +set -o pipefail + +init(){ + local pcscd_running=$(ps -aux | grep [p]cscd) + if [ -z "$pcscd_running" ]; then + echo "starting pcscd in backgroud" + pcscd --debug --apdu + pcscd --hotplug + else + echo "pcscd is running in already: ${pcscd_running}" + fi +} + +init + +"$@"