This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from ipunkt/justb81-dockerfile-12
Add docker container functionality
- Loading branch information
Showing
6 changed files
with
87 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Dockerfile | ||
.gitignore | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
ARG PHP_VERSION=7.2-rc | ||
FROM php:${PHP_VERSION}-alpine | ||
|
||
ARG PHP_VERSION | ||
ARG DOCKER_COMPOSE_VERSION=1.15.0 | ||
ARG RANCHER_COMPOSE_VERSION=0.12.5 | ||
ARG RANCHERIZE_HOME=/home/rancherize | ||
ARG DEFAULT_EDITOR=vi | ||
|
||
LABEL maintainer="b.rang@ipunkt.biz" \ | ||
version.php=$PHP_VERSION \ | ||
version.docker-compose=$DOCKER_COMPOSE_VERSION \ | ||
version.rancher-compose=$RANCHER_COMPOSE_VERSION | ||
|
||
# prepare pseudo project directory for npm_modules install | ||
RUN ["mkdir", "$RANCHERIZE_HOME"] | ||
RUN ["chmod", "777", "$RANCHERIZE_HOME"] | ||
|
||
# there lies the home | ||
ENV HOME=$RANCHERIZE_HOME | ||
|
||
# default editor | ||
ENV EDITOR=DEFAULT_EDITOR | ||
|
||
# install packages | ||
RUN apk update \ | ||
&& apk add --no-cache \ | ||
git \ | ||
docker \ | ||
py-pip | ||
|
||
COPY [".", "/opt/rancherize"] | ||
WORKDIR /opt/rancherize | ||
|
||
# load rancher-compose | ||
RUN curl -SL "https://github.com/rancher/rancher-compose/releases/download/v$RANCHER_COMPOSE_VERSION/rancher-compose-linux-amd64-v$RANCHER_COMPOSE_VERSION.tar.gz" \ | ||
| tar xz \ | ||
&& mv rancher-compose-*/rancher-compose /usr/local/bin/ && cp /usr/local/bin/rancher-compose /usr/local/bin/rancher-compose-$RANCHER_COMPOSE_VERSION | ||
|
||
# install composer packages | ||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \ | ||
&& php composer-setup.php \ | ||
&& php -r "unlink('composer-setup.php');" \ | ||
&& ./composer.phar install && rm composer.phar | ||
|
||
# install docker-compose | ||
RUN pip install docker-compose==$DOCKER_COMPOSE_VERSION | ||
|
||
ENTRYPOINT ["/opt/rancherize/rancherize"] | ||
#ENTRYPOINT ["/bin/sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
docker run -it -v $HOME/.rancherize:/home/rancherize/.rancherize -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):$(pwd) -w $(pwd) -e "USER_ID=$(id -u)" -e "GROUP_ID=$(id -g)" ipunktbs/rancherize $* |