forked from aws/s2n-tls
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dev: add s2n-dev Dockerfile (aws#1887)
- Loading branch information
Showing
9 changed files
with
141 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,5 @@ cd cppcheck | |
git checkout 1.88 | ||
|
||
make -j $JOBS | ||
|
||
rm -rf .git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
codebuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
REPOSITORY_URI ?= awslabs/s2n-dev | ||
|
||
build: | ||
@cp -R ../codebuild/ ./codebuild/ | ||
@REPOSITORY_URI=$(REPOSITORY_URI) docker-compose build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"). | ||
# You may not use this file except in compliance with the License. | ||
# A copy of the License is located at | ||
# | ||
# http://aws.amazon.com/apache2.0 | ||
# | ||
# or in the "license" file accompanying this file. This file 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. | ||
|
||
version: '3.8' | ||
services: | ||
ubuntu_18.04_openssl-1.1.1_gcc9: | ||
build: | ||
args: | ||
UBUNTU_VERSION: 18.04 | ||
OPENSSL_VERSION: openssl-1.1.1 | ||
GCC_VERSION: 9 | ||
context: ./ | ||
dockerfile: ./ubuntu/Dockerfile | ||
image: ${REPOSITORY_URI}:ubuntu_18.04_openssl-1.1.1_gcc9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
ARG UBUNTU_VERSION=18.04 | ||
|
||
FROM ubuntu:${UBUNTU_VERSION} | ||
|
||
WORKDIR /opt/s2n | ||
|
||
ARG OPENSSL_VERSION=openssl-1.1.1 | ||
ARG GCC_VERSION=9 | ||
ARG ZSH_THEME=cypher | ||
|
||
ENV S2N_LIBCRYPTO=${OPENSSL_VERSION} \ | ||
GCC_VERSION=${GCC_VERSION} \ | ||
BUILD_S2N=true \ | ||
TESTS=integration | ||
|
||
# The `s2n_setup_env` assumes bash, not sh | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
# set up user account | ||
RUN set -eux; \ | ||
apt-get update; \ | ||
apt-get -y install --no-install-recommends\ | ||
curl sudo zsh unzip gnupg2 software-properties-common python-pip rubygems wget; \ | ||
gem install bundler; \ | ||
useradd -m s2n-dev; \ | ||
echo "s2n-dev ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/s2n-dev; \ | ||
chmod 0440 /etc/sudoers.d/s2n-dev; \ | ||
mkdir -p /home/s2n-dev/s2n; \ | ||
curl -L https://github.com/ohmyzsh/ohmyzsh/archive/master.zip -o /tmp/oh-my-zsh.zip; \ | ||
unzip /tmp/oh-my-zsh.zip -d /tmp; \ | ||
mkdir -p /home/s2n-dev/.zsh/plugins; \ | ||
mkdir -p /home/s2n-dev/.zsh/themes; \ | ||
cp /tmp/ohmyzsh-master/oh-my-zsh.sh /home/s2n-dev/.zsh/init.sh; \ | ||
cp -R /tmp/ohmyzsh-master/lib /home/s2n-dev/.zsh; \ | ||
cp /tmp/ohmyzsh-master/themes/${ZSH_THEME}.zsh-theme /home/s2n-dev/.zsh/themes/theme.zsh-theme; \ | ||
rm -rf /tmp/oh-my-zsh.zip /tmp/ohmyzsh-master; \ | ||
echo $'# ZSH setup\n\ | ||
export DISABLE_UPDATE_PROMPT=true\n\ | ||
export DISABLE_AUTO_UPDATE=true\n\ | ||
export ZSH="/home/s2n-dev/.zsh"\n\ | ||
export ZSH_THEME="theme"\n\ | ||
plugins=()\n\ | ||
source $ZSH/init.sh\n\ | ||
\n\ | ||
# s2n setup\n\ | ||
export S2N_LIBCRYPTO='"$S2N_LIBCRYPTO"$'\n\ | ||
export BUILD_S2N=true\n\ | ||
export GCC_VERSION='"$GCC_VERSION"$'\n\ | ||
export TESTS=integration\n\ | ||
export TEST_DEPS_DIR=/opt/s2n/test-deps\n\ | ||
cd /home/s2n-dev/s2n && source /opt/s2n/codebuild/bin/s2n_setup_env.sh\n\ | ||
' > /home/s2n-dev/.zshrc; \ | ||
chown -R s2n-dev:s2n-dev /home/s2n-dev; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
apt-get clean; \ | ||
echo done | ||
|
||
ADD codebuild codebuild | ||
|
||
# install dependencies | ||
RUN set -eux; \ | ||
export LD_LIBRARY_PATH=""; \ | ||
. codebuild/bin/s2n_setup_env.sh; \ | ||
codebuild/bin/s2n_install_test_dependencies.sh; \ | ||
rm -rf /var/lib/apt/lists/*; \ | ||
apt-get clean; \ | ||
echo done | ||
|
||
USER s2n-dev | ||
WORKDIR /home/s2n-dev/s2n | ||
CMD ["/bin/zsh","-l"] |