Unable to create a container with dbt image - dbt

I pulled a dbt image from my azure container registry and now unable to create a container using below command for this dbt image
sudo docker run -it ( image id)
i want to do some patching to the current version of the activity.emphasized text

Related

docker adding chromedriver to path and running dotnet test

We're working on a small docker image container for windows to run a specflow test in a dotnet core projecct. The problem we have is that we can't get chromedriver to work as well as running the dotnet test command.
The specflow project we're running just contains one hello world testcase which we can run without chromedriver, but then we get the error message "OpenQA.Selenium.DriverServiceNotFoundException : The chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable."
We're providing an instance of chromedriver in the project so we don't have to download it.
The dockerfile we're running:
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
WORKDIR /src
COPY . .
ENV PATH="/src/chromedriver:$PATH"
RUN dotnet test
We're using this command to run it: docker build . --build-arg HTTP_PROXY=http://PROXY:8080 --build-arg HTTPS_PROXY=http://PROXY:8080 --rm
We expect the specflow tests to run with chromedriver. When we run the dockerfile we get the error message "'dotnet' is not recognized as an internal or external command, operable program or batch file." It seems that the chromedriver is not added correctly to the PATH variable. We need it there to be able to run the specflow tests.
Does anybody know how to configure the dockerfile to work correctly with chromedriver?
Thanks for your time.

Continuous Deployment not working

I need to continually build a create-react-app application and deploy it to Amazon S3 bucket.
I have written the following CircleCi config.yml:
version: 2
jobs:
build:
docker:
- image: circleci/node:7.10
steps:
- checkout
- run: npm install
- run: npm run build
deployment:
prod:
branch: circle-config-test
commands:
- aws s3 sync build/ s3://http://www.typing-coacher.net.s3-website.eu-central-1.amazonaws.com/ --delete
What I think should happens:
I have a docker container, I install the application, build it and the files are resting ready in build folder.
I am running the command listed in CircleCi docs and the build files are moving from the docker machine to s3 bucket.
To deploy a project to S3, you can use the following command in the
deployment section of circle.yml:
aws s3 sync <path-to-files> s3://<bucket-URL> --delete
What actually happens:
Application is being install and build files are being created, but nothing happen with deployment. it doesn't even appear on the builds console.
What Am i missing?
disclaimer: CircleCI Developer Advocate
Everything from the deployment: line and down shouldn't be there. That's syntax for CircleCI 1.0 while the rest of your config file is CircleCI 2.0.
You can either:
Create a new step and check for the branch name with Bash. If it's circle-config-test, then run the deployment commands. You'll also need to install the AWS CLI in that build.
Using [CircleCI Workflows], create a deployment job with a branch filter for circle-config-test. You can use any image that contains the AWS CLI or install it yourself. The CI Builds: AWS Docker image contains this for you.

How to run build in local machine with drone.io

Does the build have to run on the drone.io server? Can I run the build locally? Since developers need to pass the build first before pushing code to github, I am looking for a way to run the build on developer local machine. Below is my .drone.yml file:
pipeline:
build:
image: node:latest
commands:
- npm install
- npm test
- npm run eslint
integration:
image: mongo-test
commands:
- mvn test
It includes two docker containers. How to run the build against this file in drone? I looked at the drone cli but it doesn't work in my expected way.
#BradRydzewski comment is the right answer.
To run builds locally you use drone exec. You can check the docs.
Extending on his answer, you must execute the command in the root of your local repo, exactly where your .drone.yml file is. If your build relies on secrets, you need to feed these secrets through the command line using the --secret or --secrets-file option.
When running a local build, there is no cloning step. Drone will use your local git workspace and mount it in the step containers. So, if you checkout some other commit/branch/whatever during the execution of the local build, you will mess things up because Drone will see those changes. So don't update you local repo while the build is running.

How to run integration test inside a docker container in drone pipeline

I have a docker image built up for mongodb test. You can be found from zhaoyi0113/mongo-uat. When start a docker container from this image, it will create a few mongodb instances which will take a few minutes to startup. Now I want to run my integration test cases inside this container by drone CI. Below is my .drone.yml file:
pipeline:
build:
image: node:latest
commands:
- npm install
- npm test
- npm run eslint
integration:
image: zhaoyi0113/mongo-uat
commands:
- npm install
- npm run integration
There are two steps in this pipeline, the first is to run unit test in a nodejs project. The second one integration is used to run integration test cases in the mongodb docker image.
when I run drone exec it will get an error failed to connect to mongo instance. I think that because the mongodb instance needs a few minutes to startup. The commands npm install and npm run integration should be run after the mongodb instance launched. How can I delay the build commands?
EDIT1
The image zhaoyi0113/mongo-uat has mongodb environment. It will create a few mongodb instances. I can run this command docker run -d zhaoyi0113/mongo-uat to launch this container after that I can attach to this container to see the mongodb instances. I am not sure how drone launch the docker container.
The recommended approach to integration testing is to place your service containers in the service section of the Yaml [1][2]
Therefore in order to start a Mongo service container I would create the below Yaml file. The Mongo service will start on the default port at 127.0.0.1 and be accessible from your pipeline containers.
pipeline:
test:
image: node
commands:
- npm install
- npm run test
integration:
image: node
commands:
- npm run integration
services:
mongo:
image: mongo:3.0
This is the recommended approach for testing services like MySQL, Postgres, Mongo and more.
[1] http://readme.drone.io/usage/getting-started/#services
[2] http://readme.drone.io/usage/services-guide/
As a short addendum to Brads answer: While the mongo service will run on 127.0.0.1 on the drone host machine - it will not be possible to reach the service from this IP within the node app. To access the service you would reference its service name (here: mongo).

NPM & Docker Build

I want to "build" my npm build and create a docker image with it. That means I need a docker image that is able to a) run npm and b) run docker.
Currently I struggle in finding / creating such a docker image. How can I solve my problem?
Thanks!
Edit:
I managed to have a combined container, but my build is not able to find a running docker instance:
Post http:///var/run/docker.sock/v1.20/build?cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=registry.gitlab.com%2Ftss-repocar%2Fapp&ulimits=null: dial unix /var/run/docker.sock: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
Post http:///var/run/docker.sock/v1.20/images/registry.gitlab.com/tss-repocar/app/push?tag=: dial unix /var/run/docker.sock: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
Use Packer. You run commands in Packer to do all of your NPM setup, and it will spit out a Docker container.
Here is packer
https://www.packer.io/docs/
And then I found this
https://www.npmjs.com/package/node-packer
To build docker images your build container must have access to /var/run/docker.sock (or you have to use Docker in Docker).
Assuming you have your gitlab-ci-multi-runner in a Docker Container itself, change /etc/gitlab-runner/config.toml to look like this:
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]