Skip to content

Commit

Permalink
Replace deprecated Docker image with AWS base image for Lambda and in…
Browse files Browse the repository at this point in the history
…troduce Ruby 3.2 support (#86)
  • Loading branch information
lukasz-horonziak authored Sep 11, 2023
1 parent fd0bf0e commit 6a01621
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function bundleInstall(){
fs.mkdirSync(this.build_path)
const options = {cwd : this.ruby_layer, encoding : 'utf8'}
if (this.options.use_docker) {
docker_name = 'lambci/lambda:build-'+this.serverless.service.provider.runtime
docker_name = 'public.ecr.aws/sam/build-'+this.serverless.service.provider.runtime+':latest-x86_64'
ps=docker(['version'], options,this.cli)
if (ps.error && ps.error.code === 'ENOENT') {
throw new Error('docker command not found. Please install docker https://www.docker.com/products/docker-desktop');
Expand All @@ -71,7 +71,7 @@ function bundleInstall(){
path.join(this.ruby_layer,'Dockerfile'))
buildDocker = true
}else if (this.options.docker_yums || this.options.environment) {
docker_steps =['FROM lambci/lambda:build-'+this.serverless.service.provider.runtime]
docker_steps =['FROM public.ecr.aws/sam/build-'+this.serverless.service.provider.runtime+':latest-x86_64']
if (this.options.docker_yums) {
this.options.docker_yums.forEach(function(package_name) {
docker_steps.push('RUN yum install -y '+package_name)
Expand Down Expand Up @@ -165,7 +165,7 @@ function setBundleConfig(version, config){
}


function zipDir(folder_path,targetPath,zipOptions){
function zipDir(folder_path,targetPath,zipOptions){
zip = new JSZip()
return addDirtoZip(zip, folder_path)
.then(() => {
Expand Down Expand Up @@ -287,6 +287,6 @@ function bundleGems() {
.then(bundleInstall)
.then(zipBundleFolder)
.then(configureLayer)
}
}

module.exports = { bundleGems, excludePackage };

0 comments on commit 6a01621

Please sign in to comment.