Category : bash

I have a Dockerfile which contains: RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get -y update && apt-get install -y –no-install-recommends curl gnupg2 apt-transport-https # Postgres && echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list && curl -s https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add – # MS-SQL 2017 && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add – && curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list ..

Read more

I am trying to run sshpass inside Docker container I forked that project so that is my dockerfile: FROM postgres:9.4 RUN set -x && apt-get update && apt-get install -y –no-install-recommends ca-certificates curl sshpass lftp rsync openssh-client && rm -rf /var/lib/apt/lists/* && curl -L https://github.com/odise/go-cron/releases/download/v0.0.7/go-cron-linux.gz | zcat > /usr/local/bin/go-cron && chmod a+x /usr/local/bin/go-cron && apt-get ..

Read more

I am creating a small bash script to automate some simple tasks to handle my docker container. One of the commands I have is to clear the logs, but this doesnt work responding with "Permission denied". The issue with this is I am using sudo. if [ $CLEAR_OPT == true ] then DOCKER_LOG_PATH=$(docker inspect $DOCKER_ID ..

Read more

I am trying to append to lines to the .bashrc in a Dockerfile for a VS Code devcontainer. But I am not able to preserve the string as they are. bind ‘"e[A": history-search-backward’ bind ‘"e[B": history-search-forward’ My most recent attempt looks like this, but I have already tried a couple different variants using backticks and ..

Read more

Below is the previous version of entrypoint.sh for our service’s docker image. #!/usr/bin/env bash pushd /app/Liquibase ./liquibase –classpath=postgresjdbc.jar –driver=org.postgresql.Driver –url="jdbc:postgresql://${DATABASE_SERVER}:${DATABASE_PORT}/${DATABASE_NAME}" –username="${USERNAME}" –password="${PASSWORD}" –changeLogFile="./Scripts/db-changelog.xml" update status=$? popd echo if [ $status -ne 0 ] then exit $status fi ./MyServices.API In a multi-container environment, every docker container will try to run the liquibase update resulting in deadlock. ..

Read more

Having issue getting the exit code in dockerfile RUN bash -c " if [ $FLAVOR = E2ETEST ] ; then ./gradlew clean :app:testDevDebugUnitTest –tests abcTest; ./gradlew clean :app:testDevDebugUnitTest –tests cdeTest -PtestType="e2e" executeE2ETests; ./gradlew clean :app:testDevDebugUnitTest –tests defTest ; the flavor comes from yaml file how could i get the exit code for the 3 gradle ..

Read more

I have been banging my head against the wall for 8 hours now, but cant seem to fix this issue. I have a json looking like this: { "connector.class": "com.mongodb.kafka.connect.MongoSinkConnector", "tasks.max": 1, "key.converter": "org.apache.kafka.connect.storage.StringConverter", "key.converter.schemas.enable": false, "value.converter": "io.confluent.connect.avro.AvroConverter", "value.converter.schema.registry.url": "CONNECTOR_SCHEMA_REGISTRY_URL", "value.converter.schemas.enable": true, "topics": "CONNECTOR_TOPICS", "name": "CONNECTOR_NAME", "connection.uri": "CONNECTOR_MONGODB_CONNECTION_URI", "database": "CONNECTOR_MONGODB_DATABASE_NAME", "collection": "CONNECTOR_MONGODB_COLLECTION_NAME", "max.num.retries": 1, "retries.defer.timeout": ..

Read more

I’m writing a shell script where I try to run the bioinformatics tool BCFtools in a dockerised container which I have pulled from quay.io. The code below works fine: # Create a directory to hold output: mkdir -p ~/out/vardict_vcf/bcftools_stats/QC sudo docker run -v /home/dnanexus:/home –rm quay.io/biocontainers/bcftools:1.13–h3a49de5_0 bcftools stats /home/out/vardict_vcf/output/test.vardict.vcf | sudo tee ~/out/vardict_vcf/bcftools_stats/QC/test.vardict.stats.txt However my ..

Read more