Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

Commit

Permalink
Add support for Amazon Linux v1
Browse files Browse the repository at this point in the history
Thanks @ramarnat!

Closes: #622
  • Loading branch information
flx42 committed Mar 3, 2018
1 parent 7a6370d commit 9ea83df
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
36 changes: 36 additions & 0 deletions Dockerfile.amzn1
Original file line number Diff line number Diff line change
@@ -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
28 changes: 27 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ 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

centos7: 17.12.1.ce-centos7 17.12.0.ce-centos7 17.09.1.ce-centos7 17.09.0.ce-centos7 17.06.2.ce-centos7 17.03.2.ce-centos7 1.13.1-centos7 1.12.6-centos7

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)" \
Expand Down Expand Up @@ -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:$@

0 comments on commit 9ea83df

Please sign in to comment.