|
| 1 | +# Docker Image for SSH agent container. Last revision 18.10.2016 |
| 2 | +# |
| 3 | +# Copyright (c) Andreas Urbanski, 2016 |
| 4 | +# |
| 5 | +# Permission is hereby granted, free of charge, to any person obtaining a |
| 6 | +# copy of this software and associated documentation files (the "Software"), |
| 7 | +# to deal in the Software without restriction, including without limitation |
| 8 | +# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 9 | +# and/or sell copies of the Software, and to permit persons to whom the |
| 10 | +# Software is furnished to do so, subject to the following conditions: |
| 11 | +# |
| 12 | +# The above copyright notice and this permission notice shall be included |
| 13 | +# in all copies or substantial portions of the Software. |
| 14 | +# |
| 15 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 16 | +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 18 | +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 21 | +# THE SOFTWARE. |
| 22 | +FROM alpine:3.4 |
| 23 | + |
| 24 | +MAINTAINER Andreas Urbanski <urbanski.andreas@gmail.com> |
| 25 | + |
| 26 | +# Install dependencies |
| 27 | +RUN apk add --no-cache \ |
| 28 | + bash \ |
| 29 | + openssh \ |
| 30 | + socat \ |
| 31 | + && rm -rf /var/cache/apk/* |
| 32 | + |
| 33 | +# Copy entrypoint script to container |
| 34 | +COPY entry.sh /entry.sh |
| 35 | + |
| 36 | +# Setup environment variables; export SSH_AUTH_SOCK from socket directory |
| 37 | +ENV SOCKET_DIR /.ssh-agent |
| 38 | +ENV SSH_AUTH_SOCK ${SOCKET_DIR}/socket |
| 39 | +ENV SSH_AUTH_PROXY_SOCK ${SOCKET_DIR}/proxy-socket |
| 40 | + |
| 41 | +VOLUME ${SOCKET_DIR} |
| 42 | + |
| 43 | +ENTRYPOINT ["/entry.sh"] |
| 44 | + |
| 45 | +CMD ["ssh-agent"] |
0 commit comments