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

Commit

Permalink
ci: standardize dockerfiles
Browse files Browse the repository at this point in the history
- [x] use alpine 3.12
- [x] common `apk add` where possible
- [x] update copyright header where possible

Signed-off-by: Ernesto Ojeda <ernesto.ojeda@intel.com>
  • Loading branch information
ernestojeda committed Dec 18, 2020
1 parent a339fdb commit 70f5f2b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 19 deletions.
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']
)
25 changes: 22 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,10 @@ WORKDIR /device-grove
RUN /device-grove/scripts/build_deps.sh 1
RUN /device-grove/scripts/build.sh

FROM alpine:3.11
ARG BASE=alpine:3.12
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

0 comments on commit 70f5f2b

Please sign in to comment.