Skip to content

Docker Perforce Images (p4d, perforce-swarm, git-fusion, sample depot, and a base image)

Notifications You must be signed in to change notification settings

tetsuoanimation/docker-perforce

 
 

Repository files navigation

Docker Perforce Images

A collection of Perforce docker images:

  • Perforce Base, an image containing the official repo and the p4 client
  • Perforce P4D Server
  • Perforce Git Fusion
  • Perforce Swarm

Docker Pulls

Installation

All operations on the images and repositories are encapsulated in Makefiles.

Build images (the Makefile's default target):

$ make [image]

Tag your images with your repo username and push the images to the Docker registry:

$ docker login
$ DOCKER_REPO=ambakshi make image push

Usage

The perforce server images are contained in their respective directories. Each server comes with an example 'run' target that you can use to get a server up and running quickly.

$ make -C perforce-server run
$ make -C

docker-compose

Using docker-compose it is much simpler to setup a working environment. Modify the docker-compose.yml and the supplied envfile to customize your site. Once done, run:

$ make
$ docker volume create --name=perforce
$ docker volume create --name=gfp4depot
$ docker-compose up -d perforce    # for p4d server
$ docker-compose up -d gfperforce  # for p4d + git-fusion server

The perforce-git-fusion image is setup to run its own p4d server. If you prefer to run a seperate git+ssh server and connect to a running p4d instance, please open a PR.

You won't be able to run both perforce and gfperforce at the same time, because both containers bind to host port 1666. If you need to run both please modify the docker-compose.yml.

If you want to use a directory on your host to mount into your perforce container, you'll need to modify the docker-compose.yml file accordingly:

services:
  perforce:
    volumes:
      /path/on/host:/data
  gfperforce:
    volumes:
      /path/on/host:/data

Testing

Download a local p4 client for your OS from Perforce's repo, and run:

$ export P4CONFIG=.p4config

$ p4 info
User name: p4admin
Client name: titan7
Client host: titan7.local
Client unknown.
Current directory: /home/abakshi/projects/docker-perforce
Peer address: 172.18.0.1:38526
Client address: 172.18.0.1
Server address: perforce:1666
Server root: /data/p4depot
Server date: 2017/03/07 20:33:37 +0000 UTC
Server uptime: 00:04:26
Server version: P4D/LINUX26X86_64/2016.2/1487173 (2017/02/14)
ServerID: p4depot
Server services: standard
Server license: none
Case Handling: sensitive

Create a new client:

$ p4 client myclient
Perforce password (P4PASSWD) invalid or unset.
Attempting login for user 'p4admin' against server '1666'
Enter password:
User p4admin logged in.
Client myclient saved.

$ p4 -c myclient add README.md
//depot/README.md#1 - opened for add

$ p4 -c myclient submit

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

2019/05/01: - Upgrade to P4 2018.2 - Upgrade gosu to 1.11 - Upgrade s6 to 1.22.1.0 - Remove various calls to bash -x that caused P4PASSWD to be printed - Pulled in fix pull request #10 from nathanperkins/fix-log-location - Use tail -F instead of -f, so we follow log rotation - Pass http_proxy as an optional docker build arg - Makefile loads an optional local.mk where you can configure (amongst other things) http_proxy

2017/02/07: - Upgrade to P4 to 2016.2 - Switched default base image to centos7

2016/05/15: - Added docker-compose support

2016/05/14: - Fixed perforce-git-fusion

2014/12/24: - Initial version

Credits

License

About

Docker Perforce Images (p4d, perforce-swarm, git-fusion, sample depot, and a base image)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 44.4%
  • Shell 37.1%
  • Makefile 18.5%