An image has Teradata ODBC well configured and data analyze python package installed.
8.4K
Docker Image with Teradata unixODBC connection ability.
Details refer to teradata_unixodbc
If you're familiar with Docker, have it configured, and know exactly what you'd like to run, this one-liner should work in most cases:
# The following command will start a container which mapping your current work directory to /data in the container and return you an interactive shell
docker run -it -v ${PWD}:/data:rw zhlh/teradata_unixodbc bash
If this is your first time using Docker or any of the images in this git repository, do the following to get started.
cd teradata_unixodbc
docker build -t your-own-image-name[:tag] .
docker pull zhlh/teradata_unixodbc
Teradata ODBC is well configured in this image, the following code demos how to use python teradata module to connect to Teradata through ODBC.
import teradata
udaExec = teradata.UdaExec (appName="MyApp", version="1.0", logConsole=True)
conn = udaExec.connect(method="odbc", system="td_host_addr",username="td_username", password="td_password");
for row in conn.execute("SELECT GetQueryBand()"):
print(row)
docker run -it -v ${PWD}:/batchOps:rw zhlh/teradata_unixodbc python
docker run -it -v ${PWD}:/batchOps:rw zhlh/teradata_unixodbc bash
docker run -it -v ${PWD}:/batchOps:rw zhlh/teradata_unixodbc R
Run any command or script with the image.
docker run -v ${PWD}:/batchOps:rw zhlh/teradata_unixodbc cmd
If you think the docker command is too long, make it simple! Use the run.py in the current directory.
${PWD}/run.py your-comand-with-aruguments
# Example
# list all disk usage information in the container
${PWD}/run.py /bin/df -h
# Output
jbmuser@lxc-docker-7200:~/docker-stacks/teradata_unixodbc$ ${PWD}/run.py /bin/df -h
[run.py:25 - run() - INFO ] Run OS commamd: docker run --rm -v $(pwd):/batchOps:rw -v /tmp:/tmp:rw zhlh/teradata_unixodbc /bin/df -h > /tmp/run_20160304Mar03.log 2>&1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Filesystem Size Used Avail Use% Mounted on
none 60G 49G 8.0G 86% /
tmpfs 5.9G 0 5.9G 0% /dev
tmpfs 5.9G 0 5.9G 0% /sys/fs/cgroup
/dev/disk/by-uuid/21813bed-571e-4fcc-905d-32bc13641493 60G 49G 8.0G 86% /tmp
shm 64M 0 64M 0% /dev/shm
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[run.py:32 - run() - INFO ] cmd return code: 0, command output store in file /tmp/run_20160304Mar03.log
Maintainer: [Zhang Lihui](mailto:[email protected]?subject=teradata_unixodbc docker image issue)
Any bugs or suggestions is welcomed.
Content type
Unrecognized
Digest
Size
1.3 GB
Last updated
over 10 years ago
docker pull zhlh/teradata_unixodbc