diff --git a/Dockerfile.cockpit b/Dockerfile.cockpit index be1dedd..62c657d 100644 --- a/Dockerfile.cockpit +++ b/Dockerfile.cockpit @@ -16,13 +16,15 @@ # Install cockpit RUN apt-get install -y cockpit cockpit-docker +# Install sshd +RUN apt-get install -y ssh + # Prepare services RUN rm -rf /etc/dbus-1 RUN mkdir /var/run/dbus -RUN mkdir /home/jryland +RUN mkdir /run/sshd -ENTRYPOINT (rm /var/run/dbus/pid || true) && dbus-daemon --system && /usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type= && /usr/lib/cockpit/cockpit-ws -p 9092 - +ENTRYPOINT (rm /var/run/dbus/pid || true) && /usr/sbin/sshd && dbus-daemon --system && /usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type= && /usr/lib/cockpit/cockpit-ws -p 9092 diff --git a/Dockerfile.cockpit b/Dockerfile.cockpit index be1dedd..62c657d 100644 --- a/Dockerfile.cockpit +++ b/Dockerfile.cockpit @@ -16,13 +16,15 @@ # Install cockpit RUN apt-get install -y cockpit cockpit-docker +# Install sshd +RUN apt-get install -y ssh + # Prepare services RUN rm -rf /etc/dbus-1 RUN mkdir /var/run/dbus -RUN mkdir /home/jryland +RUN mkdir /run/sshd -ENTRYPOINT (rm /var/run/dbus/pid || true) && dbus-daemon --system && /usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type= && /usr/lib/cockpit/cockpit-ws -p 9092 - +ENTRYPOINT (rm /var/run/dbus/pid || true) && /usr/sbin/sshd && dbus-daemon --system && /usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type= && /usr/lib/cockpit/cockpit-ws -p 9092 diff --git a/Jenkinsfile b/Jenkinsfile index 3be0d68..ea8ae16 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,12 @@ sh 'docker build --tag macosx-build-agent ./ -f Dockerfile.build.macosx' sh 'docker build --tag cockpit ./ -f Dockerfile.cockpit' } + }, + stage('Deploy') { + steps { + echo 'Starting..' + sh 'docker-compose up -d -f docker-compose.yml' + } } } } diff --git a/Dockerfile.cockpit b/Dockerfile.cockpit index be1dedd..62c657d 100644 --- a/Dockerfile.cockpit +++ b/Dockerfile.cockpit @@ -16,13 +16,15 @@ # Install cockpit RUN apt-get install -y cockpit cockpit-docker +# Install sshd +RUN apt-get install -y ssh + # Prepare services RUN rm -rf /etc/dbus-1 RUN mkdir /var/run/dbus -RUN mkdir /home/jryland +RUN mkdir /run/sshd -ENTRYPOINT (rm /var/run/dbus/pid || true) && dbus-daemon --system && /usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type= && /usr/lib/cockpit/cockpit-ws -p 9092 - +ENTRYPOINT (rm /var/run/dbus/pid || true) && /usr/sbin/sshd && dbus-daemon --system && /usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type= && /usr/lib/cockpit/cockpit-ws -p 9092 diff --git a/Jenkinsfile b/Jenkinsfile index 3be0d68..ea8ae16 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,12 @@ sh 'docker build --tag macosx-build-agent ./ -f Dockerfile.build.macosx' sh 'docker build --tag cockpit ./ -f Dockerfile.cockpit' } + }, + stage('Deploy') { + steps { + echo 'Starting..' + sh 'docker-compose up -d -f docker-compose.yml' + } } } } diff --git a/README.md b/README.md index 69d4292..05a5b7d 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,19 @@ The jenkins job builds the docker images + + +We can also start the images on the server + + - using docker-compose, we can start a set of services + + - currently this is cockpit-ws + + +Requirements: + + sudo mkdir -p /var/run/cockpit-ws/home/jryland/.ssh + sudo chown -R jryland:jryland /var/run/cockpit-ws/home/jryland + + + diff --git a/Dockerfile.cockpit b/Dockerfile.cockpit index be1dedd..62c657d 100644 --- a/Dockerfile.cockpit +++ b/Dockerfile.cockpit @@ -16,13 +16,15 @@ # Install cockpit RUN apt-get install -y cockpit cockpit-docker +# Install sshd +RUN apt-get install -y ssh + # Prepare services RUN rm -rf /etc/dbus-1 RUN mkdir /var/run/dbus -RUN mkdir /home/jryland +RUN mkdir /run/sshd -ENTRYPOINT (rm /var/run/dbus/pid || true) && dbus-daemon --system && /usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type= && /usr/lib/cockpit/cockpit-ws -p 9092 - +ENTRYPOINT (rm /var/run/dbus/pid || true) && /usr/sbin/sshd && dbus-daemon --system && /usr/sbin/remotectl certificate --ensure --user=root --group=cockpit-ws --selinux-type= && /usr/lib/cockpit/cockpit-ws -p 9092 diff --git a/Jenkinsfile b/Jenkinsfile index 3be0d68..ea8ae16 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,6 +13,12 @@ sh 'docker build --tag macosx-build-agent ./ -f Dockerfile.build.macosx' sh 'docker build --tag cockpit ./ -f Dockerfile.cockpit' } + }, + stage('Deploy') { + steps { + echo 'Starting..' + sh 'docker-compose up -d -f docker-compose.yml' + } } } } diff --git a/README.md b/README.md index 69d4292..05a5b7d 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,19 @@ The jenkins job builds the docker images + + +We can also start the images on the server + + - using docker-compose, we can start a set of services + + - currently this is cockpit-ws + + +Requirements: + + sudo mkdir -p /var/run/cockpit-ws/home/jryland/.ssh + sudo chown -R jryland:jryland /var/run/cockpit-ws/home/jryland + + + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..1d7c97e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ + +services: + cockpit-ws: + image: cockpit-ws:latest + container_name: cockpit-ws + hostname: cockpit.localdomain + volumes: + # Authentication + - /etc/passwd:/etc/passwd:ro + - /etc/group:/etc/group:ro + - /etc/shadow:/etc/shadow:ro + # Docker access + - /var/run/docker.sock:/var/run/docker.sock + # Dummy home directories + - /var/run/cockpit-ws/home:/home + restart: always + privileged: true + ports: + - "9092:9092" +