Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
data/
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
# PlasticSCM Docker image
# PlasticSCM Docker tooling

## Using Docker Compose
To build:
```
docker-compose -f docker-compose.yaml build plastic
```
To run:
```
docker-compose -f docker-compose.yaml up -d plastic
```

To add a user: `PLASTIC, PLEASE UPDATE, I DON'T KNOW THIS`

To refresh the server: `PLASTIC, PLEASE UPDATE, I DON'T KNOW THIS`


#### The next three instructions assume you are looking at directory in which you cloned this repository.
* To upload a new license file: replace the file named `plasticd.lic` in the `data/conf` directory
* To backup the databases: copy the files from the `data/sqlite` directory
* To retrieve logs: copy the files from the `data/logs` directory


## Classic mode
To build:

docker build --rm=true -t <image_name> plastic
docker build --rm=true -t <image_name> plastic -f Dockerfile.14

To run:

Expand Down
40 changes: 40 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: '3.4'
services:
plastic:
#image: plasticscm/server
build:
context: ./plastic
dockerfile: Dockerfile.18
volumes:
- ./data/conf:/conf
- ./data/sqlite:/db/sqlite
- ./data/logs:/logs
ports:
- "7178:7178/tcp" # Dashboard?
- "8087:8087/tcp" # Classic
- "8088:8088/tcp" # SSL
#stdin_open: true
#tty: true
entrypoint: /entry.sh
command: /opt/plasticscm5/server/plasticd --daemon

plasticlabs:
#image: plasticscm/server
build:
context: ./plastic
dockerfile: Dockerfile.labs.18
volumes:
- ./data/conf:/conf
- ./data/sqlite:/db/sqlite
- ./data/logs:/logs
ports:
- "7178:7178/tcp" # Dashboard?
- "8087:8087/tcp" # Classic
- "8088:8088/tcp" # SSL
#stdin_open: true
#tty: true
entrypoint: /entry.sh
command: /opt/plasticscm5/server/plasticd --daemon

networks:
default:
File renamed without changes.
40 changes: 40 additions & 0 deletions plastic/Dockerfile.18
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM ubuntu:bionic

LABEL maintainer="Miguel González <mgonzalez@codicefactory.com>"
LABEL contributor="cybik"

RUN apt-get update && \
apt-get install -y wget

RUN mkdir -p /conf && \
mkdir -p /logs && \
mkdir -p /confbase && \
mkdir -p /db/sqlite

RUN apt-get install -y gnupg2 && \
echo "deb https://www.plasticscm.com/plasticrepo/stable/ubuntu/ ./" >> /etc/apt/sources.list.d/plastic.list && \
wget -q https://www.plasticscm.com/plasticrepo/stable/ubuntu/Release.key -O - | apt-key add -

RUN DEBIAN_FRONTEND=noninteractive apt-get -q update && apt-get install -y plasticscm-server-core && plasticsd stop
ADD entry.sh /entry.sh

ADD loader.log.conf /confbase
ADD db.conf /confbase

RUN { \
clconfigureserver --language=en --port=8087 --workingmode=UPWorkingMode; \
[ -f /opt/plasticscm5/server/users.conf ] && mv /opt/plasticscm5/server/users.conf /confbase || touch /confbase/users.conf; \
[ -f /opt/plasticscm5/server/groups.conf ] && mv /opt/plasticscm5/server/groups.conf /confbase || touch /confbase/groups.conf; \
mv /opt/plasticscm5/server/plasticd.lic /confbase; \
chmod 755 /entry.sh; \
}

EXPOSE 7178
EXPOSE 8087

VOLUME /conf
VOLUME /db/sqlite
VOLUME /logs

ENTRYPOINT "/entry.sh"
CMD ["/opt/plasticscm5/server/plasticd", "--daemon"]
40 changes: 40 additions & 0 deletions plastic/Dockerfile.labs.18
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM ubuntu:bionic

LABEL maintainer="Miguel González <mgonzalez@codicefactory.com>"
LABEL contributor="cybik"

RUN apt-get update && \
apt-get install -y wget

RUN mkdir -p /conf && \
mkdir -p /logs && \
mkdir -p /confbase && \
mkdir -p /db/sqlite

RUN apt-get install -y gnupg2 && \
echo "deb https://www.plasticscm.com/plasticrepo/labs/ubuntu/ ./" >> /etc/apt/sources.list.d/plastic.list && \
wget -q https://www.plasticscm.com/plasticrepo/labs/ubuntu/Release.key -O - | apt-key add -

RUN DEBIAN_FRONTEND=noninteractive apt-get -q update && apt-get install -y plasticscm-server-core
ADD entry.sh /entry.sh

ADD loader.log.conf /confbase
ADD db.conf /confbase

RUN { \
clconfigureserver --language=en --port=8087 --workingmode=UPWorkingMode; \
[ -f /opt/plasticscm5/server/users.conf ] && mv /opt/plasticscm5/server/users.conf /confbase || touch /confbase/users.conf; \
[ -f /opt/plasticscm5/server/groups.conf ] && mv /opt/plasticscm5/server/groups.conf /confbase || touch /confbase/groups.conf; \
mv /opt/plasticscm5/server/plasticd.lic /confbase; \
chmod 755 /entry.sh; \
}

EXPOSE 7178
EXPOSE 8087

VOLUME /conf
VOLUME /db/sqlite
VOLUME /logs

ENTRYPOINT "/entry.sh"
CMD ["/opt/plasticscm5/server/plasticd", "--daemon"]
26 changes: 26 additions & 0 deletions plastic/entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#! /bin/bash
set -e
for FILE in "users.conf" "groups.conf" "plasticd.lic" "loader.log.conf" "db.conf"; do
if [ -f /confbase/$FILE ] && [ ! -e /conf/$FILE ]; then
cp /confbase/$FILE /conf/$FILE
fi
if [ ! -e /opt/plasticscm5/server/$FILE ]; then
ln -s /conf/$FILE /opt/plasticscm5/server/$FILE
fi
done

# If and when that one is finally there.
if [ ! -e /opt/plasticscm5/server/plasticd.token.lic ]; then
ln -s /conf/plasticd.token.lic /opt/plasticscm5/server/plasticd.token.lic
fi

# first boot?
if [ ! -f /conf/provisionned ]; then
umtool cu root root
umtool cg administrators
umtool autg root administrators
touch /conf/provisionned
fi

echo "Executing this: $@"
exec "$@"
5 changes: 5 additions & 0 deletions straightrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /bin/bash

docker run -it -v `pwd`/data/conf:/conf \
-v `pwd`/data/sqlite:/db/sqlite \
-v `pwd`/data/logs:/logs plasticdocker_plastic $@