Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hallelujah committed Apr 18, 2018
0 parents commit 3fd53bb
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# unixODBC

0 comments on commit 3fd53bb

Please sign in to comment.