Add support for Amazon Linux v1

Thanks @ramarnat!

Closes: #622
This commit is contained in:
Felix Abecassis 2018-03-02 17:38:58 -08:00
parent 7a6370d39f
commit 9ea83dfb58
2 changed files with 63 additions and 1 deletions

36
Dockerfile.amzn1 Normal file
View file

@ -0,0 +1,36 @@
FROM amazonlinux:1
# packaging dependencies
RUN yum install -y \
rpm-build && \
rm -rf /var/cache/yum/*
# packaging
ARG PKG_VERS
ARG PKG_REV
ARG RUNTIME_VERSION
ARG DOCKER_VERSION
ENV VERSION $PKG_VERS
ENV RELEASE $PKG_REV
ENV RUNTIME_VERSION $RUNTIME_VERSION
ENV DOCKER_VERSION $DOCKER_VERSION
# output directory
ENV DIST_DIR=/tmp/nvidia-container-runtime-$PKG_VERS/SOURCES
RUN mkdir -p $DIST_DIR
COPY nvidia-docker $DIST_DIR
COPY daemon.json $DIST_DIR
WORKDIR $DIST_DIR/..
COPY rpm .
CMD rpmbuild --clean -bb \
-D "_topdir $PWD" \
-D "version $VERSION" \
-D "release $RELEASE" \
-D "runtime_version $RUNTIME_VERSION" \
-D "docker_version $DOCKER_VERSION" \
SPECS/nvidia-docker2.spec && \
mv RPMS/noarch/*.rpm /dist

View file

@ -11,7 +11,7 @@ DIST_DIR := $(CURDIR)/dist
.NOTPARALLEL:
.PHONY: all
all: xenial centos7 stretch
all: xenial centos7 stretch amzn1
xenial: 17.12.1-xenial 17.12.0-xenial 17.09.1-xenial 17.09.0-xenial 17.06.2-xenial 17.03.2-xenial 1.13.1-xenial 1.12.6-xenial
@ -19,6 +19,8 @@ centos7: 17.12.1.ce-centos7 17.12.0.ce-centos7 17.09.1.ce-centos7 17.09.0.ce-cen
stretch: 17.12.1-stretch 17.12.0-stretch 17.09.1-stretch 17.09.0-stretch 17.06.2-stretch 17.03.2-stretch
amzn1: 17.09.1.ce-amzn1 17.06.2.ce-amzn1 17.03.2.ce-amzn1
17.12.1-xenial:
$(DOCKER) build --build-arg RUNTIME_VERSION="$(RUNTIME_VERSION)+docker17.12.1-1" \
--build-arg DOCKER_VERSION="docker-ce (= 17.12.1~ce-0~ubuntu) | docker-ee (= 17.12.1~ee-0~ubuntu)" \
@ -194,3 +196,27 @@ stretch: 17.12.1-stretch 17.12.0-stretch 17.09.1-stretch 17.09.0-stretch 17.06.2
--build-arg PKG_REV="$(PKG_REV)" \
-t nvidia-docker2:$@ -f Dockerfile.stretch .
$(DOCKER) run --rm -v $(DIST_DIR)/stretch:/dist:Z nvidia-docker2:$@
17.09.1.ce-amzn1:
$(DOCKER) build --build-arg RUNTIME_VERSION="$(RUNTIME_VERSION)-1.docker17.09.1.amzn1" \
--build-arg DOCKER_VERSION="docker = 17.09.1ce" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.09.1.ce.amzn1" \
-t nvidia-docker2:$@ -f Dockerfile.amzn1 .
$(DOCKER) run --rm -v $(DIST_DIR)/amzn1:/dist:Z nvidia-docker2:$@
17.06.2.ce-amzn1:
$(DOCKER) build --build-arg RUNTIME_VERSION="$(RUNTIME_VERSION)-1.docker17.06.2.amzn1" \
--build-arg DOCKER_VERSION="docker = 17.06.2ce" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.06.2.ce.amzn1" \
-t nvidia-docker2:$@ -f Dockerfile.amzn1 .
$(DOCKER) run --rm -v $(DIST_DIR)/amzn1:/dist:Z nvidia-docker2:$@
17.03.2.ce-amzn1:
$(DOCKER) build --build-arg RUNTIME_VERSION="$(RUNTIME_VERSION)-1.docker17.03.2.amzn1" \
--build-arg DOCKER_VERSION="docker = 17.03.2ce" \
--build-arg PKG_VERS="$(VERSION)" \
--build-arg PKG_REV="$(PKG_REV).docker17.03.2.ce.amzn1" \
-t nvidia-docker2:$@ -f Dockerfile.amzn1 .
$(DOCKER) run --rm -v $(DIST_DIR)/amzn1:/dist:Z nvidia-docker2:$@