mirror of
https://github.com/luzifer-docker/sql-proxy.git
synced 2025-01-02 03:51:16 +00:00
Initial version
This commit is contained in:
commit
0cf096ec05
2 changed files with 22 additions and 0 deletions
18
Dockerfile
Normal file
18
Dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
|||
FROM alpine:3.8
|
||||
|
||||
MAINTAINER Knut Ahlers <knut@ahlers.me>
|
||||
|
||||
ENV KEYNAME=id_rsa
|
||||
|
||||
SHELL ["/bin/sh", "-ex", "-c"]
|
||||
RUN apk --no-cache add openssh \
|
||||
&& adduser -h /home/mysql -S -D -u 100 mysql
|
||||
|
||||
USER mysql
|
||||
|
||||
VOLUME "/home/mysql/.ssh"
|
||||
EXPOSE 3306/tcp
|
||||
|
||||
COPY run.sh /usr/local/bin
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/run.sh"]
|
4
run.sh
Executable file
4
run.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
set -eux
|
||||
|
||||
exec /usr/bin/ssh -N -L 0.0.0.0:3306:127.0.0.1:3306 -i /home/mysql/.ssh/${KEYNAME} "$@"
|
Loading…
Reference in a new issue