containers: an instrumented Java application standalone container
[pcp.git] / build / containers / pcp-base / Dockerfile
blobf05d807843f191fbf8c909f9e501ba89511433cc
2 # Dockerfile to build the base container image. This uses a specific
3 # Fedora version, and is intended as the base image for all the other
4 # PCP containers (i.e. they are layered on top of this one).
6 # Build:   $ docker build -t pcp-base .
7 # Debug:   $ `docker inspect --format='{{.Config.Labels.RUN}}' pcp-base`
9 FROM fedora:25
10 MAINTAINER PCP Development Team <pcp@groups.io>
11 ENV NAME pcp-base
12 ENV IMAGE pcp-base
14 # Update the Fedora base image and clean the dnf cache
15 # (normally disabled during development)
17 RUN dnf -y install createrepo.noarch && dnf -y update && dnf clean all
19 # Set up a repo for bintray packages to be installed. This is the default.
20 # Note that this repo specifies enabled=1. All container images
21 # based on pcp-base will use the default enabled repo to install
22 # packages, so to use e.g. the pcp-devel repo instead, just edit
23 # the enabled flag to specify an alternate repo you want to use.
25 COPY pcp.repo /etc/yum.repos.d/pcp.repo
27 # Set up a repo for local packages to be installed. This is only for use
28 # during development. To use this repo, change enabled=0 to enabled=1.
29 # Here we expect $(TOPDIR)/build/containers/RPMS to contain packages to be
30 # available for the container image, e.g. from $(TOPDIR)/Makepkgs builds.
32 #RUN mkdir -p /root/rpmbuild/RPMS
33 #COPY RPMS/*.rpm /root/rpmbuild/RPMS/
34 #RUN createrepo /root/rpmbuild/RPMS
36 # Install minimal pcp (i.e. pcp-conf) and it's dependencies, clean the cache.
37 # This is intended as the base image for all other PCP containers. The
38 # bintray repo is enabled by default, see comments above.
39 RUN dnf -y install pcp-conf && dnf clean all
41 # Run in the container as root - avoids host/container user mismatches
42 ENV PCP_USER root
43 ENV PCP_GROUP root
45 # Denote this as a container environment, for rc scripts
46 ENV PCP_CONTAINER_IMAGE pcp-base
48 # Since this can be invoked as an interactive container, setup bash.
49 COPY bash_profile /root/.bash_profile
51 # RUN labels are used by the 'atomic' command, e.g. atomic run pcp-base
52 # Without this command, one can use docker inspect (see "Debug:" above).
54 LABEL RUN docker run \
55 --interactive --tty \
56 --privileged --net=host --pid=host --ipc=host \
57 --volume=/run:/run \
58 --volume=/sys:/sys:ro \
59 --volume=/etc/localtime:/etc/localtime:ro \
60 --volume=/var/lib/docker:/var/lib/docker:ro \
61 --volume=/var/log:/var/log \
62 --volume=/dev/log:/dev/log \
63 --name=pcp-base pcp-base
65 # The command to run (bash). When this command exits, then the container exits.
66 # This is the default command and parameters, mainly for debugging, and usually
67 # would be overridden by higher layers of the container build.
69 CMD ["/bin/bash", "-l"]