xo/usql docker
if need oracle, please:
1, InstallingUnixODBC
2, @See "Install Oracle Instant Client and SDK"
put 3 files downloaded to the Dockerfile directory:
# /path/to/Dockerfile/oracle/
unixODBC-2.3.1.tar.gz
instantclient-basic-linux.x64-12.1.0.2.0.zip
instantclient-sdk-linux.x64-12.1.0.2.0.zip
# build docker
docker build -t xousql .
# if exists
docker rm -f xousql
# run a container
docker run --name xousql -dt xousql [dburl] # can enter by 'docker exec'
docker run --name xousql -it xousql [dburl] # exited when '\q'
# run as commond
# put 1.sql at $PWD/sql, this will generate the query result to 1.csv at result/1.csv
docker run --name xousql -d -v $PWD/sql:/data xousql -C -f 1.sql -o result/1.csv [dburl]
you can save the container to a tar file, and transfer to the server without internet but can access your database,
and then load the tar file to run a docker container.
docker save -o xosql.tar xousql
docker load -i xosql.tar