Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

ci: standardize dockerfiles #58

Merged
Merged
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
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

edgeXBuildCApp (
project: 'device-grove-c',
dockerBuildFilePath: 'scripts/Dockerfile.alpine-3.11-base',
dockerFilePath: 'scripts/Dockerfile.alpine-3.11',
dockerBuildFilePath: 'scripts/Dockerfile.alpine-base',
dockerFilePath: 'scripts/Dockerfile.alpine',
arch: ['arm64']
)
23 changes: 20 additions & 3 deletions scripts/Dockerfile.alpine-3.11 → scripts/Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
ARG BASE=alpine:3.11
#
# Copyright (c) 2020 IOTech Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

ARG BASE=alpine:3.12
FROM ${BASE} as builder
MAINTAINER Bindu Rao <bindu@iotechsys.com>
LABEL maintainer="Bindu Rao <bindu@iotechsys.com>"
RUN apk add --update --no-cache build-base git gcc cmake make linux-headers yaml-dev libmicrohttpd-dev curl-dev util-linux-dev ncurses-dev

COPY scripts /device-grove/scripts
Expand All @@ -12,7 +28,8 @@ WORKDIR /device-grove
RUN /device-grove/scripts/build_deps.sh 1
RUN /device-grove/scripts/build.sh

FROM alpine:3.11
FROM ${BASE}
WORKDIR /

RUN apk add --update --no-cache linux-headers yaml libmicrohttpd curl libuuid

Expand Down
14 changes: 0 additions & 14 deletions scripts/Dockerfile.alpine-3.11-base

This file was deleted.

30 changes: 30 additions & 0 deletions scripts/Dockerfile.alpine-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 2020 IOTech Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

ARG BASE=alpine:3.12
FROM ${BASE}
LABEL maintainer="Bindu Rao <bindu@iotechsys.com>"
RUN apk add --update --no-cache build-base git gcc cmake make linux-headers yaml-dev libmicrohttpd-dev curl-dev util-linux-dev ncurses-dev

COPY scripts /device-grove/scripts
COPY src /device-grove/src/
COPY Makefile /device-grove/Makefile
RUN cd /device-grove && make -s version | tee /device-grove/VERSION && rm -f /device-grove/Makefile
RUN mkdir -p /device-grove/build

WORKDIR /device-grove
RUN /device-grove/scripts/build_deps.sh 1
RUN /device-grove/scripts/build.sh