Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mjstealey/jenkins-nginx-docker
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: myhpom/jenkins-nginx-docker
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Aug 8, 2018

  1. Merge pull request #1 from mjstealey/master

    Get latest README from mjstealey
    cbcunc authored Aug 8, 2018
    Copy the full SHA
    cb06cf3 View commit details

Commits on Aug 23, 2018

  1. Changes for AWS /etc/hosts.d

    cbcunc committed Aug 23, 2018
    Copy the full SHA
    6921a76 View commit details
  2. Add safeguard to /etc/hosts.d

    cbcunc committed Aug 23, 2018
    Copy the full SHA
    a9322cf View commit details
Showing with 26 additions and 9 deletions.
  1. +3 −3 Dockerfile
  2. +8 −6 docker-compose.yml
  3. +15 −0 docker-entrypoint.sh
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM jenkins/jenkins:lts
MAINTAINER Michael J. Stealey <michael.j.stealey@gmail.com>

ARG docker_version=17.12.0~ce-0~debian
ARG docker_version=18.06.0~ce~3-0~debian

USER root
RUN apt-get update && apt-get -y install \
@@ -19,8 +19,8 @@ RUN apt-get update && apt-get -y install \
&& apt-get update && apt-get -y install \
docker-ce=${docker_version}

ENV UID_JENKINS=1000
ENV GID_JENKINS=1000
ENV UID_JENKINS=1003
ENV GID_JENKINS=1003

COPY docker-entrypoint.sh /docker-entrypoint.sh

14 changes: 8 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -7,8 +7,9 @@ services:
- '80:80'
- '443:443'
volumes:
- ./nginx:/etc/nginx/conf.d
- ./logs/nginx:/var/log/nginx
- /home/jenkins/nginx/etc/nginx/conf.d:/etc/nginx/conf.d
- /home/jenkins/nginx/etc/ssl/certs:/etc/ssl/certs
- /home/jenkins/nginx/var/log/nginx:/var/log/nginx
networks:
- jenkins_network
links:
@@ -26,14 +27,15 @@ services:
- '50000:50000'
- '50022:50022'
volumes:
- ./jenkins_home:/var/jenkins_home
- /home/jenkins/jenkins/var/jenkins/home:/var/jenkins_home
- /home/jenkins/jenkins/etc/hosts.d:/etc/hosts.d
- /var/run/docker.sock:/var/run/docker.sock
networks:
- jenkins_network
environment:
- UID_JENKINS=1000
- GID_JENKINS=1000
- JENKINS_OPTS="--prefix=/jenkins"
- UID_JENKINS=1003
- GID_JENKINS=1003
- JENKINS_OPTS="--prefix=/"
restart: always

networks:
15 changes: 15 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -20,5 +20,20 @@ fi
echo "jenkins ALL=(root) NOPASSWD: /usr/bin/docker" > /etc/sudoers.d/jenkins
chmod 0440 /etc/sudoers.d/jenkins

HOSTS=/etc/hosts
HOSTSD=/etc/hosts.d
if [ -d "$HOSTSD" ]; then
for FILENAME in ${HOSTSD}/*.conf; do
FIRST=$(head -n 1 "$FILENAME")
if ! grep -xq "$FIRST" ${HOSTS}; then
printf "\n" >> ${HOSTS}
cat ${FILENAME} >> ${HOSTS}
echo Concatenated ${FILENAME} to ${HOSTS}
else
echo ${FILENAME} already concatenated to ${HOSTS}
fi
done
fi

# run Jenkins as user jenkins
su jenkins -c 'cd $HOME; /usr/local/bin/jenkins.sh'