Tune azure-c-sdk-x86 docker image

This commit is contained in:
dilin-MS 2019-08-05 13:53:36 +08:00
Родитель 8ab0195a28
Коммит 7720c91a0c
6 изменённых файлов: 20 добавлений и 14 удалений

Просмотреть файл

@ -45,4 +45,5 @@ fi
echo "Push docker image $new_docker_image to $ACR_domain..."
docker tag $docker_image $new_docker_image
docker push $new_docker_image
# docker rmi $new_docker_image
docker rmi $docker_image
docker rmi $new_docker_image

Просмотреть файл

@ -1,20 +1,23 @@
ARG base_image=ubuntu:18.04
FROM ${base_image}
ARG c_sdk_version=2019-04-11
ARG c_sdk_repo=github.com/Azure/azure-iot-sdk-c-pnp
ARG c_sdk_version=public-preview-utopia
ARG github_username=default-username
ARG github_token=default-token
RUN apt-get update && \
apt-get install -y git cmake build-essential curl libcurl4-openssl-dev libssl-dev uuid-dev
RUN mkdir /workdir && \
chown -R 1000:1000 /workdir
RUN mkdir /work && \
chown -R 1000:1000 /work
# setup new user builder so that we don't run it all as root
RUN groupadd -o -g $(stat -c "%g" /workdir) "builder" && \
useradd -N -g $(stat -c "%g" /workdir) -m -o -u $(stat -c "%u" /workdir) -p builder "builder"
RUN groupadd -o -g $(stat -c "%g" /work) "builder" && \
useradd -N -g $(stat -c "%g" /work) -m -o -u $(stat -c "%u" /work) -p builder "builder"
USER builder
WORKDIR /workdir
RUN git clone https://github.com/azure/azure-iot-sdk-c.git -b ${c_sdk_version} --recursive
WORKDIR /work
RUN git clone https://${github_username}:${github_token}@${c_sdk_repo} --recursive -b ${c_sdk_version}
RUN cd azure-iot-sdk-c && \
mkdir cmake && \
cd cmake && \

Просмотреть файл

@ -1,3 +1,7 @@
{
"image_name": "iot-device-cube:1.0.0-azure-c-sdk-20190411-ubuntu-x86"
"image_name": "iot-device-cube:1.0.0-azure-c-sdk-20190411-ubuntu-x86",
"arg": {
"github_username": "your-github-username",
"github_token": "your-github-token"
}
}

Просмотреть файл

@ -1,5 +1,5 @@
{
"applicationName": "",
"buildCommand": "bash /work/compile_app.sh ./src",
"buildCommand": "bash /work/compile_app.sh ./",
"buildTarget": "/work/azure-iot-sdk-c/cmake/iot_application"
}

Просмотреть файл

@ -1,5 +1,5 @@
{
"applicationName": "",
"buildCommand": "bash /work/compile_app.sh ./src",
"buildCommand": "bash /work/compile_app.sh ./",
"buildTarget": "/work/azure-iot-sdk-c/cmake/iot_application"
}

Просмотреть файл

@ -171,15 +171,13 @@ export class AzureConfigFileHandler {
async appendComponent(type: ScaffoldType, component: AzureComponentConfig) {
try {
const scaffoldType = ScaffoldType.Local;
const azureConfigContent =
await FileUtility.readFile(type, this.configFilePath, 'utf8');
const azureConfigs =
JSON.parse(azureConfigContent as string) as AzureConfigs;
azureConfigs.componentConfigs.push(component);
await FileUtility.writeFile(
scaffoldType, this.configFilePath,
JSON.stringify(azureConfigs, null, 4));
type, this.configFilePath, JSON.stringify(azureConfigs, null, 4));
return azureConfigs;
} catch (error) {
throw new Error('Invalid azure components config file.');