Skip to content

Commit

Permalink
Update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
guyzsarun committed Sep 21, 2023
1 parent 79b407b commit e7c7f57
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 72 deletions.
29 changes: 2 additions & 27 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: docker/Dockerfile.rpm
file: docker/Dockerfile
tags: ${{ env.BASE_TAG }}
build-args: |
IMAGE=${{ matrix.version }}
Expand All @@ -36,32 +36,7 @@ jobs:
run: |
docker run --rm ${{ env.BASE_TAG }} python3 -m pytest -v
# test-json:
# name: Test JSON Conversion
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Check out Git repository
# uses: actions/checkout@v2

# - uses: docker/setup-buildx-action@v2

# - name: Build Docker image
# uses: docker/build-push-action@v4
# with:
# context: .
# file: docker/Dockerfile
# tags: ${{ env.BASE_TAG }}
# load: true
# cache-from: type=gha
# cache-to: type=gha,mode=max

# - name: Unit test
# run: |
# docker run --rm ${{ env.BASE_TAG }} python3 -m pytest -v

# test-rpm:
# name: Package RPM
# package-rpm:
# needs: build
# runs-on: ubuntu-latest
# steps:
Expand Down
39 changes: 19 additions & 20 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
FROM almalinux:8
ARG IMAGE=almalinux:8
FROM $IMAGE

MAINTAINER Sarun Nuntaviriyakul <sarun.nuntaviriyakul@cern.ch>
LABEL org.opencontainers.image.source https://github.com/guyzsarun/xrootd-cmsjson

WORKDIR /xrootd

ARG IMAGE=almalinux:8
RUN yum -y update && \
yum install -y dnf \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
https://repo.opensciencegrid.org/osg/3.6/osg-3.6-el8-release-latest.rpm \
yum install -y \
dnf \
https://repo.opensciencegrid.org/osg/3.6/osg-3.6-el$(echo $IMAGE | cut -d ":" -f 2)-release-latest.rpm \
epel-release

RUN dnf group install -y "Development Tools"

# CMS TFC dependency
RUN yum install -y cmake \
wget \
xrootd \
python3-devel \
python3-xrootd \
xrootd-devel \
pcre-devel \
xerces-c-devel \
xrootd-devel \
https://cbs.centos.org/kojifiles/packages/jsoncpp/1.9.4/4.el8s/x86_64/jsoncpp-1.9.4-4.el8s.x86_64.rpm \
https://cbs.centos.org/kojifiles/packages/jsoncpp/1.9.4/4.el8s/x86_64/jsoncpp-devel-1.9.4-4.el8s.x86_64.rpm


RUN pip3 install pytest
RUN yum install -y --enablerepo=osg-contrib \
cmake \
xrootd \
python3-devel \
python3-xrootd \
xrootd-devel \
pcre-devel \
xerces-c-devel \
jsoncpp \
jsoncpp-devel

COPY . .

RUN mkdir -p build
RUN cd build && \
RUN mkdir -p build && \
cd build && \
cmake .. -DBUILD_TEST=true && \
make && \
make install
Expand Down
39 changes: 14 additions & 25 deletions docker/Dockerfile.rpm
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,22 @@ RUN yum -y update && \
RUN dnf group install -y "Development Tools"

# CMS TFC dependency
RUN yum install -y cmake \
xrootd \
python3-devel \
python3-xrootd \
xrootd-devel \
pcre-devel \
xerces-c-devel \
xrootd-devel

RUN yum install -y --enablerepo=osg-contrib \
jsoncpp \
# CMS TFC dependency
RUN yum install -y --enablerepo=osg-contrib \
cmake \
xrootd \
python3-devel \
python3-xrootd \
xrootd-devel \
pcre-devel \
xerces-c-devel \
jsoncpp \
jsoncpp-devel

RUN pip3 install pytest

COPY . .

# RUN mkdir -p /root/rpmbuild/SOURCES
# RUN tar -zvcf /root/rpmbuild/SOURCES/xrootd-cmstfc.tar.gz --transform s/xrootd/xrootd-cmstfc-2.0.0/ ../xrootd

# RUN rpmbuild -bb spec/xrootd-cmstfc.spec

# RUN yum install -y /root/rpmbuild/RPMS/x86_64/xrootd-cmstfc-2.0.0-1.el8.x86_64.rpm

RUN mkdir -p build
RUN cd build && \
cmake .. -DBUILD_TEST=true && \
make && \
make install
RUN mkdir -p /root/rpmbuild/SOURCES
RUN tar -zvcf /root/rpmbuild/SOURCES/xrootd-cmstfc.tar.gz --transform s/xrootd/xrootd-cmstfc-2.0.0/ ../xrootd

RUN rpmbuild -bb spec/xrootd-cmstfc.spec
RUN yum install -y /root/rpmbuild/RPMS/x86_64/xrootd-cmstfc-2.0.0-2.el8.x86_64.rpm

0 comments on commit e7c7f57

Please sign in to comment.