Probably a stupid question (as usual ;-) ):
I have a local lando installation for Drupal 9 and would like to publish the docker image to the GitHub Container Registry when pushing a new commit.
The problem is that lando doesn't have a dockerfile in the repository ( think...)!
How can I write a workflow for pushing an image if I don't have a dockerfile, or what's the most basic dockerfile I could use in that case?
Thanks.
Related
Tell in advance - I'm not a java/maven/linux developer/user.
I have a github project I need to build and package - https://github.com/simonellistonball/nifi-webdav-bundle with provided instruction https://www.tutorialspoint.com/apache_nifi/apache_nifi_custom_processor.htm. But I don't understand how to solve this with docker image https://hub.docker.com/_/maven. In my environment I have CentOS VM with git and docker installed.
My plan is: git clone repo into host VM, create docker volume, copy repo there, run container with some params (dunno which exact) and remove container.
Am I thinking right way? Is it even possible with maven container without creating my own image?
You have two choices:
Map /opt/nifi/nifi-current/extensions in the container to the host and drop the nar there.
Add a Dockerfile that looks something like this:
FROM apache/nifi:1.12.1
COPY --chown=nifi ./something.nar /opt/nifi/nifi-current/lib/something.nar
I see how to specify a docker image in ray here: https://ray.readthedocs.io/en/latest/autoscaling.html#common-cluster-configurations
But I have my own Dockerfile in my repository. Is it possible to specify that that Dockerfile get spun up on every instance ray spins up? Is the only solution to push it to an external registry somewhere and specify the image name here?
If you build your own docker image locally using docker build ., it is stored in your local docker repository. And when you run autoscaler, it should look up your local repository first before it looks up the external repository.
I setup docker automated build via Github and I can build an image successfully from a Dockerfile in my GitHub repository
I have followed the thread here and here
According to the documentation, if I do my build via an automated build connected to Github, all I need is to have my Dockerfile present and it will be added.
The builds succeeds, so the automation process works.
I can even see the Readme from GitHub in the registry. But for some reason, I can't see my Dockerfile in Docker hub.
Here is an example Github repo and here is the repository in Docker hub
Is there any more configuration necessary to get the Dockerfile to docker hub?
welcome Jungo!
TL;DR
You can learn more information about why on the Docker forum.
My actual requirement is pull docker image from GitHub and build a docker image in ec2 instance and push that image to ecr. So, am just trying to clear my first step by asking help to pull image from git, very new to all this.
Let's walk through each step you're asking about in your requirements:
Pull from GitHub - You won't pull a docker image from here, however you may pull a Dockerfile from here, which would be used to build an image. The command to do this would be just like cloning any other repository: git clone <repository url>
Build the image on ec2 - First you will need to have docker installed on the ec2 instance. Assuming you're running Ubuntu on your ec2 instance, follow the good instructions on Docker's page (https://docs.docker.com/install/linux/docker-ce/ubuntu/) miror. Once docker is installed, navigate to the directory that has your Dockerfile in it (cloned from git) and type docker build . --tag mytag
Push the image to ecr - To do this, you need to have the amazon CLI installed on your box, and you need an ACCESS_KEY_ID and SECRET_ACCESS_KEY from AWS IAM. Once you have these, configure your connection by storing them as environment variables, or by typing aws configure and entering them. Once your credentials are configured, log into ECR by typing aws ecr get-login --no-include-email, and then copy/pasting the command it gives you. (you can also put ` around it to skip the copying step). This will allow you to push to ecr using docker push.
To clarify some of the points:
Github: It is a web-based hosting service for version control using git. So you can not pull docker image from Github.
To build a Docker image, you need Dockerfile. So you can fork the GitHub project which has this Dockerfile.
Then to build it on ec2, you can check out the project containing Dockerfile on ec2 server and build it using:
https://docs.docker.com/engine/reference/commandline/build/
and then you can push it to any registry using:
https://docs.docker.com/engine/reference/commandline/push/
I created a docker repo which I wanted to pull for a local copy.
I want to create an image that can be used by anyone and everyone in the team will have a common work env.
I ran this command on my Ubuntu 14.04 :
docker pull xanthelabs/dev
The output is :
Using default tag: latest
Pulling repository docker.io/xanthelabs/dev
Tag latest not found in repository docker.io/xanthelabs/dev
I am new to docker and dont know what to do to remove this error. What should I be doing?
PS: I've been able to successfully pull images that are already available on the hub like ubuntu:14.04 and centos, so I know the installation is up and working.
To pull images first you need to push something to your repo. I checked https://hub.docker.com/r/xanthelabs/dev/ and it seems that you haven't pushed anything yet.
So first (in directory with your Dockerfile):
docker build --tag xanthelabs/dev .
docker push xanthelabs/dev
And then:
docker pull xanthelabs/dev
For doing pushes you need to be logged in (docker login).