Skip to content

Commit

Permalink
Dockerized development environment
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaceccanti committed Mar 19, 2021
1 parent 3bc8a0f commit a3f04c2
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "VOMS core development",
"dockerComposeFile": "compose/docker-compose.yml",
"service": "voms_build",
"workspaceFolder": "/home/build/workspace",
"shutdownAction": "stopCompose"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
/.cproject
/.settings
/.test
/.vscode
/INSTALL
1 change: 1 addition & 0 deletions compose/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMPOSE_PROJECT_NAME=voms-core
38 changes: 38 additions & 0 deletions compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: '3.5'

volumes:
vscode-server:
dotlocal:

services:

init:
image: italiangrid/voms-build-centos7:latest
volumes:
- vscode-server:/home/build/.vscode-server
- dotlocal:/home/build/.local
command: sudo chown -R build:build /home/build/.vscode-server /home/build/.local

voms_build:
image: italiangrid/voms-build-centos7:latest

depends_on:
- init

environment:
- TZ=Europe/Rome

volumes:
- vscode-server:/home/build/.vscode-server
- dotlocal:/home/build/.local
- $HOME/grid-security:/etc/grid-security/certificates
- $HOME/ca-bundle:/etc/pki
- $HOME/vomsdir:/etc/grid-security/vomsdir:ro
- $HOME/vomses:/etc/vomses
- $HOME/.globus:/home/build/.globus:ro
- ..:/home/build/workspace:cached

entrypoint: /tini -- sleep infinity

extra_hosts:
- "dev.local.io: 192.168.65.2"
3 changes: 3 additions & 0 deletions docker/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DOCKER_IMAGE=italiangrid/voms-build-centos7
DOCKER_GIT_TAG_ENABLED=y
DOCKER_OPTS=--rm=true
29 changes: 29 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM centos:7

# Allow customization of build user ID and name
ARG BUILD_USER=build
ARG BUILD_USER_UID=501

RUN echo "include_only=.garr.it,.cern.ch" >> /etc/yum/pluginconf.d/fastestmirror.conf && \
yum clean all && \
yum install -y hostname epel-release && \
yum -y update && \
yum -y install which wget tar sudo file && \
yum -y install which wget tar sudo file && \
echo '%wheel ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
adduser --uid ${BUILD_USER_UID} ${BUILD_USER} && \
usermod -a -G wheel ${BUILD_USER} && \
yum -y install \
gdb git expat-devel autoconf automake make libtool pkgconfig openssl-devel gsoap-devel \
mysql-devel libxslt docbook-style-xsl doxygen bison gcc-c++ gcc && \
yum clean all && \
rm -rf /var/cache/yum

ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]


USER $BUILD_USER
WORKDIR /home/$BUILD_USER

0 comments on commit a3f04c2

Please sign in to comment.