diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c13449b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +FROM ubuntu:12.04 + +USER root + +RUN apt-get update -y \ + && apt-get install -y python-software-properties \ + && apt-add-repository -y ppa:brightbox/ruby-ng \ + && apt-get update -y \ + && apt-get install -y ruby2.3 ruby2.3-dev build-essential curl \ + && gem install --no-ri --no-rdoc fpm \ + && mkdir -p /opt/unixodbc \ + && chown 1000:0 /opt/unixodbc + +USER 1000 + +WORKDIR /opt/unixodbc + +ARG NAME=unixODBC +ARG VERSION=2.3.6 + +RUN curl http://www.unixodbc.org/${NAME}-${VERSION}.tar.gz | tar -xzC /opt/unixodbc \ + && cd $NAME-$VERSION \ + && ./configure --prefix=/usr \ + && make \ + && mkdir /tmp/installdir \ + && make install DESTDIR=/tmp/installdir \ + && fpm -s dir -t deb -n $NAME -v $VERSION \ + -C /tmp/installdir \ + -p ${NAME}_VERSION_ARCH.deb \ + usr diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0c456f1 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +.PHONY: build get + +VERSION ?= 2.3.6 +LOCAL_IMAGE ?= unixodbc +ARCH = amd64 +DEB = unixODBC_$(VERSION)_$(ARCH).deb + +default: build + +build: ## build the package + docker build . --tag $(LOCAL_IMAGE) --build-arg VERSION=$(VERSION) + +# unixODBC_$(VERSION)_$(ARCH).deb: build +deb: ## build and download the package + docker run --rm -d --name unixodbc-tmp $(LOCAL_IMAGE) bash + docker cp unixodbc-tmp:/opt/unixodbc/unixODBC-$(VERSION)/$(DEB) . + docker stop unixodbc-tmp + +# Check http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html +help: ## Print this help + @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) diff --git a/README.md b/README.md new file mode 100644 index 0000000..96ac0dd --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# unixODBC