Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2017-11-27 15:20:56 -05:00
parent 2c5a163ced
commit dd0d53927e
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3
2 changed files with 24 additions and 0 deletions

View File

@ -10,6 +10,7 @@ FROM ubuntu:16.04
LABEL maintainer "Jessie Frazelle <jess@linux.com>"
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" ]

18
ykman/entrypoint.sh Executable file
View File

@ -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
"$@"