2023-03-31 10:30:36 -04:00
# To build the docker image, run the following command from the shell. This command must be run in
# the "aws-doc-sdk-examples" directory, the parent directory of "cpp", in order to access the resources folder.
2023-03-01 15:59:42 -05:00
#
# 'docker build -f cpp/Dockerfile -t <a_docker_file_name> .'
#
# The following command will run the docker image, copying your AWS credentials.
# 'docker run -it --volume ~/.aws/credentials:/root/.aws/credentials <a_docker_file_name>'
FROM amazonlinux:2022
USER root
# Set up the dependencies.
RUN \
yum update -y && \
yum install -y gcc gcc-c++ make cmake libcurl-devel openssl-devel libuuid-devel pulseaudio-libs-devel git && \
yum clean all
# Build only the services needed for example code.
ENV SERVICES = "acm;autoscaling;cloudtrail;codebuild;codecommit;cognito-idp;dynamodb;ec2;elasticache;elasticbeanstalk"
ENV SERVICES = ${ SERVICES } ";elasticfilesystem;email;events;glacier;glue;guardduty;iam;kinesis;lambda;logs;monitoring"
2023-03-15 16:14:29 -04:00
ENV SERVICES = ${ SERVICES } ";monitoring;neptune;rds;rds-data;redshift;s3;s3-crt;s3-encryption;secretsmanager;sesv2;sns;sqs"
2023-03-01 15:59:42 -05:00
ENV SERVICES = ${ SERVICES } ";storagegateway;sts;transfer;transcribe;transcribestreaming"
# Build aws-sdk-cpp, building only the modules listed in SERVICES using the BUILD_ONLY argument.
RUN \
cd /usr/local && \
git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp.git && \
cd aws-sdk-cpp && \
mkdir -p build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE= Debug -DBUILD_ONLY= ${ SERVICES } -DENABLE_TESTING= ON .. && \
make --jobs= 3 install && \
cd /usr/local
# Install googletest.
RUN \
git clone https://github.com/google/googletest.git -b v1.13.0 && \
cd googletest && \
mkdir build && \
2023-02-09 13:07:30 -05:00
cd build && \
2023-03-01 15:59:42 -05:00
cmake .. -DBUILD_GMOCK= OFF && \
2023-02-09 13:07:30 -05:00
make && \
make install
2023-03-01 15:59:42 -05:00
# Copy the C++ example code.
RUN mkdir -p /src/cpp
COPY cpp /src/cpp/
# The sample files are needed for some of the automated tests.
RUN mkdir -p /src/resources/sample_files
COPY resources/sample_files /src/resources/sample_files
WORKDIR /src/cpp /
2023-02-09 13:07:30 -05:00
2022-12-23 12:48:45 -06:00
CMD [ "bash" ]
2023-02-09 13:07:30 -05:00